Adding fNET bootloader support to an project, failing on interrupt

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Adding fNET bootloader support to an project, failing on interrupt

Jump to solution
2,124 Views
joao_ribeiro
Contributor IV

Hello,

I am trying improve a simple Kinetis MCUxpresso project to work with the fnet bootlader. The bootloader and app can be flashed to the micro correctly and the app actually starts its functions currently until an interrupt comes (in this case an UART int). After the interrupt the main app stops and with the debugger I can find it at infinite while "WEAK_AV void IntDefaultHandler(void)"

I am sure that the issue must be related with the interrupt memory section of the app (as it is stated at the fnet source) , but I am not able to understand what does it mean. Where can I change the memory section at the MCUxpresso?

Also the same fnet link refers to that the app interrupt vector must be in the RAM area and not on the ROM are . What does this mean?

 

Thank you in advance for the help.

Regards

0 Kudos
1 Solution
2,113 Views
converse
Senior Contributor V

I suspect you are not using the correct vector table. If you are running a bootloader, then you need to change the VTOR (SCB->VTOR) to point at the Bootloader vector table and not the one in Flash (ROM).

View solution in original post

0 Kudos
6 Replies
2,116 Views
joao_ribeiro
Contributor IV

Hello @converse  ,

First of all thank you very much for the help and concern.

Regarding the interrupt handler I went to make sure that the interrupt was pointing into the right handler and it is. The issue remains.

I can confirm that the interrupt handler is pointing to the right function by running the app without the bootloader and it works. 

So if I have the PROGRAM_FLASH set to 0x0 and use the app without the bootloader, the app runs ok and handles the UART interrupt ; If I set the PROGRAM_FLASH to 0xf000 in order to accommodate the bootloader, then flash the two together, the app will run only until it finds an interrupt.

This is why I am thinking that it might have to do with the interrupt memory area that is not being set correctly in order to accommodate the bootloader. Does it make sense? How should it be set with the MCUxpresso?

 

Onde more thank you for the help.

Regards

0 Kudos
2,114 Views
converse
Senior Contributor V

I suspect you are not using the correct vector table. If you are running a bootloader, then you need to change the VTOR (SCB->VTOR) to point at the Bootloader vector table and not the one in Flash (ROM).

0 Kudos
2,112 Views
joao_ribeiro
Contributor IV

It sounds good.

Can you please explain me how to do that? is there a way to change it in the MCUxpresso?

0 Kudos
2,106 Views
converse
Senior Contributor V
0 Kudos
2,101 Views
joao_ribeiro
Contributor IV

Yes I have heard about Google. That was a bit rude, but thank you for the link. I will try to figure it out.

 

Once more, thank you for the sharing.

0 Kudos
2,117 Views
converse
Senior Contributor V

This means that you have not provided an interrupt handler for the USART interrupt, so it is using the default interrupt handler instead. You may well *think* you have provided the interrupt handler, but it MUST match the name in the vector table (in the startup.c file in your project). Depending on which USART you are using, it should have a name like this

void UART0_IRQHandler(void) ;

void UART1_IRQHandler(void);

void UART2_IRQHandler(void) ;

void UART3_IRQHandler(void) ;

0 Kudos