2023-01-19 08:36 AM
Hi,
I'm stuck at a problem when using a custom bootloader.
What works:
What doesn't work:
What I already analyzed (using JLink/GDB disassembly on the target):
As far as I can see, the processor should jump to 0x804feac and execute my IRQHandler.
Any idea what's going wrong?
Thank you in advance!
Solved! Go to Solution.
2023-01-19 11:50 AM
VTOR (and thus the vector table itself) must be aligned to the size of the vector table.
JW
2023-01-19 11:50 AM
VTOR (and thus the vector table itself) must be aligned to the size of the vector table.
JW
2023-01-19 12:08 PM
If you __disable_irq() expect that to be what happens, the MCU doesn't magically re-enable them, you'd need code to explicitly do so..
2023-01-19 12:30 PM
Watch also for RTOS user/system states (ie Thread vs Handler)
And transferring of control from an IRQHandler / Callback
2023-01-19 11:41 PM
Thank, you, I double checked that. VTOR is 0x8040200 so the lower 8 bits are zero, thus the alignment should be right.
2023-01-19 11:55 PM
I'm sorry I realized that I didn't make too clear what exactly happens:
When the BMDA handler should trigger, the CPU instead jumps to the defaulthandler . This happens despite all registers and memory addresses I supposed to be involved seem to be all right.
Also, all other tested ISRs do work as expected.
To further clarify that, too: When not using a bootloader, of course I changed my linker files so that the application image does not start at 0x8040200 but instead starts at 0x8000000 and therefore of course in this case the VTOR is 0. When working in this mode, everything including BDMA handler works as expected.
2023-01-20 12:23 AM
Thank you, as far as I can see, IRQs are not disabled (also see my answer below) and the system state should be handler mode (IPSR is 0x92).
Is there anything else I should look at?
2023-01-20 12:37 AM
Please read again what Jan said above.
2023-01-20 01:53 AM
Thank you both very much, indeed I've overseen the link provided as I had read the ARM documentation on that topic.
It absolutely seems that was the problem. My VTOR is 0x8040200 (10th bit set) and the vector table position of BDMA_CH1 is 0x248 (10th bit set, too)
Now everything works :thumbs_up: