Adding fNET bootloader support to an project, failing on interrupt

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Adding fNET bootloader support to an project, failing on interrupt

跳至解决方案
3,620 次查看
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 项奖励
回复
1 解答
3,609 次查看
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 项奖励
回复
6 回复数
3,612 次查看
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 项奖励
回复
3,610 次查看
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 项奖励
回复
3,608 次查看
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 项奖励
回复
3,602 次查看
converse
Senior Contributor V
0 项奖励
回复
3,597 次查看
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 项奖励
回复
3,613 次查看
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 项奖励
回复