This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C2000 bootloader problem

Other Parts Discussed in Thread: CONTROLSUITE, MOTORWARE

Hello,

I am debugging the bootloader for 28069 mcu. This example code is from controlsuite.

(1)

I found a problem in the source code.

In the CheckGPIOForceUpdate function of bl_check.c file,

//
// Check the pin to see if an update is being requested.
//
#if FORCED_UPDATE_PIN > 31
if(((GpioDataRegs.GPBDAT.all >> (FORCED_UPDATE_PIN - 32)) & 0x01) == FORCED_UPDATE_POLARITY)
#else
if(((GpioDataRegs.GPBDAT.all >> FORCED_UPDATE_PIN) & 0x01) == FORCED_UPDATE_POLARITY)
#endif
{
//
// Remember that this was a forced update.
//
g_ulForced = 1;

return(1);
}

The above red GPBDAT register should be changed to GPADAT. It is for GPIO0 ~ GPIO31.

(2)

This is another problem I can solved it by myself.

I want to use dfuprog.exe to program the application after downloading the bootloader into the c2000 mcu.

I can see the dfu device with command dfuprog -e. Then I use the command dfuprog -f to program it.

In the map file, if the used flash block size is an odd number, dfuprog will alert a download failure.

MEMORY CONFIGURATION

name origin length used unused attr fill

---------------------- -------- --------- -------- -------- ---- --------

PAGE 0:
RAML0     00008000 00000800 0000075f 000000a1 RWIX
RAML1     00008800 00000400 00000000 00000400 RWIX
OTP         003d7800 00000400 00000000 00000400 RWIX
FLASHH  003d8000 00004000 00000000 00004000 RWIX
FLASHG  003dc000 00004000 00000000 00004000 RWIX
FLASHF  003e0000 00004000 00000000 00004000 RWIX
FLASHE  003e4000 00004000 0000075f 000038a1 RWIX
FLASHD  003e8000 00004000 00003e13 000001ed RWIX
FLASHC  003ec000 00004000 00000000 00004000 RWIX
FLASHB  003f0000 00004000 00000000 00004000 RWIX
FLASHA  003f4000 00003f80 00000004 00003f7c RWIX

Then I add one or two NOP code lines to make the number to become an even number. At this time I can program this hex file into mcu correctly.

MEMORY CONFIGURATION

name origin length used unused attr fill
---------------------- -------- --------- -------- -------- ---- --------
PAGE 0:
RAML0     00008000 00000800 0000075f 000000a1 RWIX
RAML1     00008800 00000400 00000000 00000400 RWIX
OTP         003d7800 00000400 00000000 00000400 RWIX
FLASHH  003d8000 00004000 00000000 00004000 RWIX
FLASHG  003dc000 00004000 00000000 00004000 RWIX
FLASHF  003e0000 00004000 00000000 00004000 RWIX
FLASHE  003e4000 00004000 0000075f 000038a1 RWIX
FLASHD  003e8000 00004000 00003e16 000001ea RWIX
FLASHC  003ec000 00004000 00000000 00004000 RWIX
FLASHB  003f0000 00004000 00000000 00004000 RWIX
FLASHA  003f4000 00003f80 00000004 00003f7c RWIX

I want to know what is this problem? How can I set the compiler to make the used size to be an even number?

Thank you 

Fei