Interrupts not working after loading app with bootloader

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

Interrupts not working after loading app with bootloader

1,259 次查看
cavebiker
Contributor V

Hi, Fellow MQX People,

Running this on a K20DX256ZVMD10 using MQX4.0 and CW10.3

I have an app using an interrupt from SPI and everything works great if I load and start the app from address 0x0000_0000. I put the SPI interrupt ISR directly into vectors.c

Next, I fired up the MSD bootloader to bootload starting at address 0x0000_C000.

Next, in the app:

  1. Set '#define MQX_ROM_VECTORS   0' in user_config.h and small_ram_config.h
  2. Changed intflash.lcf to:

   vectorrom   (RX): ORIGIN = 0x0000C000, LENGTH = 0x00000400  # TJ changed from 0000 to C000

   cfmprotrom  (RX): ORIGIN = 0x0000C400, LENGTH = 0x00000020  # TJ changed from 0400 to C400

   rom         (RX): ORIGIN = 0x0000C420, LENGTH = 0x00033BE0  # Code + Const data TJ changed from 0420 to C420, & 3FBE0 to 33BE0 

   ram         (RW): ORIGIN = 0x1FFF8000, LENGTH = 0x00010000  # SRAM - RW data

   3. Cleaned the project and re-built.

Now, after I load the application with the bootloader and restart, the application loads and runs but the SPI interrupt never gets serviced.

Looking at the SRAM area where the vector table should have been copied to, address 0x1FFF_8000, I do not see my SPI ISR vector in the table. ??? n

I know there must be something simple I missed (I hope!)

Any ideas or help is much appreciated.

Cheers,

Tom

0 项奖励
回复
3 回复数

1,022 次查看
Monica
Senior Contributor III

Hello Tom,

have these suggestions helped you out?

Please let us know :smileywink:

Best regards,

Monica.

0 项奖励
回复

1,022 次查看
ivanpajuelo
Contributor II

Do you use 2 sets of MQX? I mean. There is an instance of MQX in bootloader and another in app?

If you have 2 copies and (of course) you are using RAM vectors, you only need to jump to the __boot method address on application part. The vectos will be copied automaticaly in boot process.

You can use the same trick if your bootloader is baremetal. You only need to take into account to set the correct addresses in lcf file.

If you use a baremetal bootloader, you can use a single lcf file to link the bootloader and MQX application together. If you want to use 2 copies of MQX, I didn't found a way to do it with a single link. You must do 2 different projects.

0 项奖励
回复

1,022 次查看
cavebiker
Contributor V

I copied my SPI2 interrupt vector from address 0x0000_C0B0 in FLASH to the SRAM vector area at 0x1FFF_80B0 and now everything works (SPI2 is my only external interrupt).

So the only thing MQX is not doing for me automatically is copying my external interrupt vectors to the SRAM area.

Does anyone know of a way to fix this problem without adding code to manually copy the vectors to SRAM?

Thanks in advance.

Cheers,

Tom

0 项奖励
回复