dsPIC33 Debugger | 17
©
1989-2022
Lauterbach
Programming the On-chip FLASH of the dsPIC33
The PRACTICE script for programming of the on-chip FLASH of a dsPIC33 can be found in the TRACE32
demo folder
~~
/demo/pic/flash/.
For programming the program memory of a dsPIC33E core, the script dspic33epxxx.cmm should be used.
For programming the program memory of a dsPIC33C master core with a single partition, the script
dspic33cxxxx.cmm should be used. For dual partition configurations of a dsPIC33C core, the script
dspic33cxxxx_dual.cmm is suitable. The dspic33chxxxslave.cmm is intended for flashing a dsPIC33CH
slave core.
Please be aware that these are just example scripts. They might need some adaption to fit your MCU.
To debug only the slave core of a dsPIC33CH target, the FLASH of the master core must be programmed at
least with a stub function including the hardware configuration words for the master and slave core.
Afterwards the slave core can be programmed. For further details see the scripts mentioned above.
Additionally, an application can be flashed to the chip’s program memory where the debug ports of the target
are disabled. To do so, the target must be brought to Prepare mode before the binary is written to flash
memory. In this case, the scripts mentioned above will fail.
Special Hints, Restrictions, and Known Problems
Special Hints
•
Due to the architecture of the dsPIC33 microcontrollers, the target will always halt two assembler
instructions after an on-chip breakpoint’s address. This can lead to imprecisions when doing HLL
steps.
Restrictions
•
The use of SW breakpoints is discouraged as setting them leads to faster reduction of the
target’s number of flash erase cycles.
•
will stop the target right after the current function is left. Because of the on-chip
breakpoint implementation, the debugger can not stop the target at the function epilog.
Known Problems
•
Stack frames not correctly shown when entering library functions.
NOTE:
All problems will be fixed in one of the next SW versions without notice!