TC277 Bootloader problem with Miniwiggler

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
LukeCY_Wei
Level 2
Level 2
25 sign-ins First like received 10 replies posted

Hi,
    My bootloader run debug mode in ADS(aurix development studio) with miniwiggler is work good, but run in normal mode always fail at download app step, seems MCU no any response in this phase, have any advice?
Thanks.

Supplementary Note:
CanRxPin:IfxMultican_RXD0A_P02_1_IN
CanTxPin:IfxMultican_TXD0_P02_0_OUT
External HardWare pin, HWCFG[3:4:5]=[0:1:1]

/***** STADABM BMI *****/
const uint32 BootModeHeader_0[] = {
    0x00000000u,                 /* STADBM first user code at 0x8000 0020h */
    0xb3590070u,                 /* BMI = 0070h BMHDID = B359h */
    0x00000000u,                 /* ChkStart */
    0x00000000u,                 /* ChkEnd */
    0x00000000u,                 /* CRCrange */
    0x00000000u,                 /* !CRCrange */
    0x791eb864u,                 /* CRChead */
    0x86e1479bu                  /* !CRChead */
};
0 Likes
7 Replies
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

Could you please provide an explanation of your pin setting and BMI setting, as well as whether your system can boot normally?

0 Likes

OK,

This bootloader will boot via CAN(RX:P02_1_IN, TX:P02_0_OUT),  External HardWare pin, HWCFG[3:4:5]=[0:1:1] chose internal start from Flash and bypass BMI table.

My system in debug mode no any problem, but not debug mode, this system is ok until download app(Erase/Write Pflash).

Thanks.

0 Likes
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

Thanks for reply. What you mentioned for downloading is from your own code of downloading or using debugger download?

For internal flash running mode, the BMI is not used. 

If you write a code for CAN to receive program from outside, then your code cannot downloading app on the Pflash, then it's the code's issue on implementation. It's another issue.

Please clarify. Thank you.

0 Likes

Hi,

    I used my boot code download app code via CAN, it's OK in debug mode(ADS+miniwiggler), but NG in normal mode(without ADS+miniwiggler).

Agent's FAE tell me need to modify BMI table that can success finish this bootloader, have any advice?

Thanks.

0 Likes
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

Based on my understanding, the boot code is responsible for loading the .hex file into the program flash memory of the device. After loading the program, it typically updates the  BMI to set the new startup address of the program. Finally, a reset is performed to initiate the execution of the newly loaded program. Is it correct?

0 Likes

Hi,
    Devie will load BMI to run program is correct, whatever boot or app, but my problem is download this app fail, not finish download then to run this app. And this boot code run in debug mode no this problem, only run in normal mode that MCU will no response then to download fail.

Truth be told, my step not enter run app phase, if my app run in 0xa000c000, should I need to modify app's BMI table as below?

/***** STADABM BMI *****/
const uint32 BootModeHeader_0[] = {
    0x8000c000u,                 /* STADBM first user code at 0x8000 0020h */
    0xb3590070u,                 /* BMI = 0070h BMHDID = B359h */
    0x00000000u,                 /* ChkStart */
    0x00000000u,                 /* ChkEnd */
    0x00000000u,                 /* CRCrange */
    0x00000000u,                 /* !CRCrange */
    0xxxxxxxxxu,                 /* CRChead */
    0xxxxxxxxxbu                  /* !CRChead */
};


Thanks.

0 Likes
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

I suggest dividing the process into two steps. First, ensure that the program download is completed successfully. During debugging, you mentioned that the download is successful, but in standalone mode, it fails. The issue lies in debugging when the debugger is disconnected. To address this problem, you can utilize UART or GPIO to output debug information, enabling you to resolve the issue.

The second step involves setting the appropriate BMI. This allows you to write the program into Pflash and set the BMI before resetting. When debugging this step, there's no need to read the hex from an external source. Instead, you can write a predefined hex or a const array (keeping it as small as possible) and write the BMI before resetting the device.

0 Likes