ASC Bootstrap loader 397 B-step

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

cross mob
User17486
Level 1
Level 1
Hi!
I make bootstrap loader for aurix tc397. The module allows you to load and execute 128 bytes of code with certain HWCFG pins. This is quite small, about 60 bytes are required only for the maintenance cycle of the cpu- and safety-watchdog. Disabling watchdog timers requires about 140 bytes.
ASCLIN0 is already preconfigured in bootstrap loader mode (baudrate, parity, etc.).
I want to use ASCLIN0 to load additional instructions after 128 bytes and then execute them. However, I have a problem:
Briefly: I cannot correctly check receipt of new bytes in ASCLIN0_RXDATA.
while (1)
{
// wdg's service

ASCLIN0_TXDATA.U = ASCLIN0_RXDATA.U;
}

In this case, the terminal is filled with zeros, but if I send a packet of bytes, they immediately return to the terminal, then zeros again. Conclusion: receiving works.
I cannot find bit fields in the asclin registers that would reliably indicate the presence of new data, here are the ones I tried: ASCLIN0_FLAGS.B.RFL, ASCLIN0_RXFIFOCON.B.FILL.
The problem is that in this mode I cannot connect with the debugger and see the configuration of the module.
I also worked with ASCLIN via iLLD and am not very clear about the behavior of the flags. Tell me how I can get the data correctly.
Perhaps the loader should be done differently, I will be glad to hear your opinion.
Regards, Gennadiy
0 Likes
1 Reply
cwunder
Employee
Employee
5 likes given 50 likes received 50 solutions authored
The ASC BSL will download exactly 128 bytes and jump to 0xC0000000 and execute the bytes you downloaded. I would suggest that you create a simple program that mimics this functionality then you can use a debugger to figure out the issue you are experiencing.
0 Likes