Tool/software:
Hello
This is a follow up on this issue. The previous thread is now locked, so I had to create this one.
I debugged the issue and in the cases that the bootloader is not coming up, DSP stops somewhere inside the c_int00 assembly instructions. It reaches the GET_DATA and GET_ADDR loops, but somewhere something goes wrong. It doesn't reach DO_BINIT. I'm not sure how this can help me to find the cause.
I have a first stage bootloader (Bl0) + a second stage BL + the main application. (Bl0 + BL + APP), each with a dedicated range in Flash. Bl0 runs from flash, at the end it jumps to BL, and Bl will jump to the APP. (BL and APP run from RAM)
The strange thing is that the same code for BL0 runs when alone (the APP is not flashed), but stops working when the APP is present. A small insignificant change in the code can make it run again. Sometimes a change makes it run, but not normally. In one case for example, it runs, but I see that a static variable that I initialized, has a different value from the beginning by itself !. In another case, the BL0 and BL run normally, but later inside the application something goes wrong with the communication for example. I don't understand, how can something in BL0 affect the APP later, after DSP has jumped to the APP. BTW, the APP is 100% sure, so nothing is wron there.
Here are some examples. The changes that I make in the BL0 code between different cases are really insignificant, it could be anything anywhere, changing the value of a macro, which isn't even used, or adding some dummy lines of code, or changing some debug messages. So whatever this is, it's not about the content of my changes. The different versions of BL0 that I wrote here are essentially the same.
BL0_version1 + BL + APP >> runs, normal
BL0_version2 + BL + APP >> doen't run
BL0_version2 + BL >> runs
BL0_version3 + BL + APP >> runs, but not normal, strange behaviour in BL0
BL0_version4 + BL + APP >> runs, but not normal, strange behaviour later in the APP
The BL0 runs from Flash. Is there anything there that could possibly explain this weird issue?
I have a separate question about that here.