• AVR Freaks

AnsweredHot!Issue with flashing MCU's from Simulink /w Embedded Coder using Lubin's Blockset

Author
f.stojanovic
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2019/05/07 01:56:09
  • Location: 0
  • Status: offline
2019/06/03 06:11:56 (permalink)
0

Issue with flashing MCU's from Simulink /w Embedded Coder using Lubin's Blockset

Hi there,
 
I've just encountered an issue using while flashing my dsPIC33 from MATLAB. Having forgot to close MPLAB X IDE, there was a collision between Matlab to dsPIC communication.
 
MATLAB

Connecting to Starter Kit on Board...
Invalid command response (sent 0x41, received 0x3f)
Connection Failed.

MPLAB X IDE
Connecting to Starter Kit on Board...
Invalid command response (sent 0x3f, received 0x41)
Connection Failed.

 
This would be a non-issue if MATLAB didn't decide to change Makefile and .TLC files, so now it uses IPE to program my dsPIC. In this configuration, any attempt to program my MCU fails. I get the success message, though I just get an erased micro after that process. I was able to fix this issue by opening IPE on my computer, forcing the error I got with MPLAB X, at which point the makefiles were reverted and everything functions correctly again.
 
I just can't find the option to manually select between MDB and IPE. It would be very handy if this feature could be added.
 
Cheers,
~Phil
#1
Lubin
Moderator
  • Total Posts : 370
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: Issue with flashing MCU's from Simulink /w Embedded Coder using Lubin's Blockset 2019/06/04 00:28:33 (permalink) ☼ Best Answerby f.stojanovic 2019/06/04 03:20:16
5 (1)
Hi Phil,
 
This choice is not provided to end user as the tool automatically pick the best available option to program the chip. Users might not even be aware that either MDB or IPE interface is used in background and we want to keep it simple as much as possible.
 
When MDB and IPE are both available, the big picture is:
  • If.hex file is generated, IPE is first choice, then MDB is used on IPE failure.
  • If .hex file is not generated, MDB is first choice, then IPE is used.
 
One MPLAB X version had an issue with programming interface which program the chip but leave the reset line active. You had to disconnect the programmer for the program to start. If you faced such issue, updating MPLAB X solves the problem (current version is 5.20).
 
We might provide a way to force the IPE/MDB programming interface if this prove to be useful.
 
Lubin
#2
f.stojanovic
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2019/05/07 01:56:09
  • Location: 0
  • Status: offline
Re: Issue with flashing MCU's from Simulink /w Embedded Coder using Lubin's Blockset 2019/06/04 03:19:59 (permalink)
0
Hi Lubin,
 
Thank you very much! You've relieved me from massive headaches, yet again.

When MDB and IPE are both available, the big picture is:
  • If.hex file is generated, IPE is first choice, then MDB is used on IPE failure.
  • If .hex file is not generated, MDB is first choice, then IPE is used.

That is exactly what solved my problem. I selected the option "Generate .hex file", as I needed it to program to program my µC with a different tool. IPE needs to fail twice for MBD to be selected, from what I've seen.
 
I might not be the only user who needs the .hex file and program with MDB. It is too trivial of an issue to add the feature just for this, as unchecking the option solves the problem. Not to mention the oddity of using a production file (.hex) and a programmer for debugging purposes. The problem will arise if users aren't aware of this programmer select logic.
What just might be more problematic is the IPE showing "Operation succeeded" while no actual flashing has occured... But that is a whole different can of worms.
 
Thank you again, Lubin!
Cheers,
~Phil
post edited by f.stojanovic - 2019/06/04 03:38:18
#3
f.stojanovic
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2019/05/07 01:56:09
  • Location: 0
  • Status: offline
Re: Issue with flashing MCU's from Simulink /w Embedded Coder using Lubin's Blockset 2019/06/04 05:02:52 (permalink)
0
For the record, here are the contents of the log file upon IPE failure (in case if it is of any use) :

juin 04, 2019 1:57:28 PM org.openide.util.NbPreferences getPreferencesProvider
AVERTISSEMENT: NetBeans implementation of Preferences not found
juin 04, 2019 1:57:28 PM  
STDERR: com.microchip.crownking 2019-06-04T11:57Z INFO Searching jar-containing directory: /C:/Program Files (x86)/Microchip/MPLABX/v5.15/mplab_platform/mplablibs/modules/ext

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.mplabinfo 2019-06-04T11:57Z INFO AC with null getTargetRegisterAddrAC162050

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.mplabinfo 2019-06-04T11:57Z INFO AC with null getTargetRegisterAddrAC162052

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.mplabinfo 2019-06-04T11:57Z INFO AC with null getTargetRegisterAddrAC162053

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.mplabinfo 2019-06-04T11:57Z INFO AC with null getTargetRegisterAddrAC162054

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.mplabinfo 2019-06-04T11:57Z INFO AC with null getTargetRegisterAddrAC162055

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.mplabinfo 2019-06-04T11:57Z INFO AC with null getTargetRegisterAddrAC162056

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.mplabinfo 2019-06-04T11:57Z INFO AC with null getTargetRegisterAddrAC162057

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.mplabinfo 2019-06-04T11:57Z INFO AC with null getTargetRegisterAddrAC162058

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.mplabinfo 2019-06-04T11:57Z INFO AC with null getTargetRegisterAddrAC162060

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.mplabinfo 2019-06-04T11:57Z INFO AC with null getTargetRegisterAddrAC162061

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.mplabinfo 2019-06-04T11:57Z INFO AC with null getTargetRegisterAddrAC162066

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.mplabinfo 2019-06-04T11:57Z INFO AC with null getTargetRegisterAddrAC162083

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.mplabinfo 2019-06-04T11:57Z INFO AC with null getTargetRegisterAddrAC244049

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.mplabinfo 2019-06-04T11:57Z INFO AC with null getTargetRegisterAddrAC244050

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.mplabinfo 2019-06-04T11:57Z INFO AC with null getTargetRegisterAddrAC244060

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find a <edc:Programming> element.

juin 04, 2019 1:57:29 PM  
STDERR: com.microchip.crownking 2019-06-04T11:57Z INFO Searching jar-containing directory: /C:/Program Files (x86)/Microchip/MPLABX/v5.15/mplab_platform/mplablibs/modules/ext

juin 04, 2019 1:57:30 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Cannot find an <edc:Oscillator> element.

juin 04, 2019 1:57:30 PM  
STDERR: com.microchip.crownking.edc 2019-06-04T11:57Z INFO Has EDS, but no <edc:ExtendedDataSpace>

juin 04, 2019 1:57:31 PM com.microchip.mplab.mdbcore.RealICETool.RIMessages OutputMessage
INFOS:

#4
Jump to:
© 2019 APG vNext Commercial Version 4.5