Bootloader problem Using CW 10.2 with MQX 3.8 on a Kinetis K60 !

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

Bootloader problem Using CW 10.2 with MQX 3.8 on a Kinetis K60 !

1,289 Views
monXii
Contributor III

Hello all,

i tried to use the FNET bootloader with MQX .. followed the user guides to modify the linker files and so on..

but when FNET flashes the MQX application and tries to start it, K60 restarts every time ..

 

then i wrote a little bootloader myself which updates an *.s19 from an sdcard ..

tries to start the MQX application .. restarts every time ..

 

then i debugged with LEDs in the MQX .. the application itself starts .. entry point is ok ..

the last debug i see on my leds i before this line:

 

_sched_start_internal();   /* WILL NEVER RETURN FROM HERE */

 

and main_task is not started ..

 

and after _sched_start_internal() is only assembler andits really difficult to debug ..

 

some here use an bootloader with an MQX main application .. ??!

 

thanks so far!

0 Kudos
6 Replies

499 Views
matute
Contributor III

Are you saving the new entry point before restart it? Try with "save" before restart, if you didn't

 

I don't have any problems with FNET and MQX (I use MCF52259 but it isn't too different)

 

Matt 

0 Kudos

499 Views
monXii
Contributor III

mh, save entry point?

 

when i upload the s19, FNET tries to start the flashed app automaticly ..

and fails with this ..

0 Kudos

499 Views
matute
Contributor III

What is the address of your MQX entry point? Is the address bigger than 0x0000C420?

Did you re-compile bsp and psp adding #define MQX_ROM_VECTORS          0 in user_config.h?

Did you modify correctly lcf of your MQX project? You can see that in .xMap generated by CW.

 

I followed these steps and it worked perfectly with Hello_Wold example.

 

By the way, you need to save the new entry point unless you have a script in your boot mode.

 

I hope it helps you

 

Matt

0 Kudos

499 Views
monXii
Contributor III

yes address is bigger ..

 

entry point -> __boot -> @ address 0x0000DF40

 

yeah, i have recompiled both with this define ..

 

xMAP looks like the application node ..

 

here the relevant snippet :

 

#>1FFF0000          __INTERNAL_SRAM_BASE (linker command file)
#>00020000          __INTERNAL_SRAM_SIZE (linker command file)
#>00000000          __INTERNAL_FLASH_BASE (linker command file)
#>00080000          __INTERNAL_FLASH_SIZE (linker command file)
#>00000000          __INTERNAL_FLEXNVM_BASE (linker command file)
#>00000000          __INTERNAL_FLEXNVM_SIZE (linker command file)
#>70000000          __EXTERNAL_MRAM_BASE (linker command file)
#>00080000          __EXTERNAL_MRAM_SIZE (linker command file)
#>70000000          __EXTERNAL_MRAM_ROM_BASE (linker command file)
#>00000000          __EXTERNAL_MRAM_ROM_SIZE (linker command file)
#>70000000          __EXTERNAL_MRAM_RAM_BASE (linker command file)
#>00080000          __EXTERNAL_MRAM_RAM_SIZE (linker command file)
#>60000000          __EXTERNAL_LCD_BASE (linker command file)
#>0001FFFF          __EXTERNAL_LCD_SIZE (linker command file)
#>60010000          __EXTERNAL_LCD_DC_BASE (linker command file)
#>00000001          __DEFAULT_PROCESSOR_NUMBER (linker command file)
#>00000400          __DEFAULT_INTERRUPT_STACK_SIZE (linker command file)
#>00000000          __KERNEL_DATA_VERIFY_ENABLE (linker command file)
#>00000800          __FLASHX_SECT_SIZE (linker command file)

# .vectors
#>0000C000          __VECTOR_TABLE_ROM_START (linker command file)
  0000C000 00000400 .vectors_rom rom_vector    (bsp_twrk60n512.a vectors.o      )
  0000C000 00000000 .vectors_rom .vectors_rom    (bsp_twrk60n512.a vectors.o      )

# .main_application
  0000C420 00000000 KERNEL  _sched_start_internal    (psp_twrk60n512.a dispatch.o     )
  0000C420 00000314 KERNEL  _@DummyFn1    (psp_twrk60n512.a dispatch.o     )
  0000C420 00000314 KERNEL  KERNEL    (psp_twrk60n512.a dispatch.o     )
  0000C420 00000000 KERNEL  $t    (psp_twrk60n512.a dispatch.o     )
  0000C424 00000000 KERNEL  _sched_run_internal    (psp_twrk60n512.a dispatch.o     )
  0000C42A 00000000 KERNEL  _sched_check_scheduler_internal    (psp_twrk60n512.a dispatch.o     )
  0000C454 00000000 KERNEL  _sched_execute_scheduler_internal    (psp_twrk60n512.a dispatch.o     )
  0000C458 00000000 KERNEL  _mqx_api_call    (psp_twrk60n512.a dispatch.o     )
  0000C45C 00000000 KERNEL  _task_block    (psp_twrk60n512.a dispatch.o     )
  0000C460 00000000 KERNEL  _svc_handler    (psp_twrk60n512.a dispatch.o     )
  0000C50A 00000000 KERNEL  _pend_svc    (psp_twrk60n512.a dispatch.o     )
  0000C59C 00000000 KERNEL  _int_kernel_isr    (psp_twrk60n512.a dispatch.o     )
  0000C682 00000000 KERNEL  _psp_exception_return    (psp_twrk60n512.a dispatch.o     )
  0000C6C4 00000000 KERNEL  _mem_test_and_set    (psp_twrk60n512.a dispatch.o     )
  0000C6E6 00000000 KERNEL  __get_PSP    (psp_twrk60n512.a dispatch.o     )
  0000C6EC 00000000 KERNEL  __get_MSP    (psp_twrk60n512.a dispatch.o     )
  0000C6F8 00000000 KERNEL  __get_PSR    (psp_twrk60n512.a dispatch.o     )
  0000C6FE 00000000 KERNEL  __enable_interrupt    (psp_twrk60n512.a dispatch.o     )
  0000C702 00000000 KERNEL  __disable_interrupt    (psp_twrk60n512.a dispatch.o     )
  0000C706 00000000 KERNEL  __get_LR    (psp_twrk60n512.a dispatch.o     )
  0000C70A 00000000 KERNEL  __get_PC    (psp_twrk60n512.a dispatch.o     )
  0000C70E 00000000 KERNEL  __get_CONTROL    (psp_twrk60n512.a dispatch.o     )
  0000C714 00000000 KERNEL  $d    (psp_twrk60n512.a dispatch.o     )
  0000C734 000000F4 .text   i2c_fm31256_clock_write_register    (i2c_fm31256.obj)
  0000C734 00000000 .text   $t    (i2c_fm31256.obj)
.

.
.

  0000DF28 00000000 .text   $d    (psp_twrk60n512.a int_inst.o     )
  0000DF40 00000000 .text   $t    (psp_twrk60n512.a cortex_boot.o  )
  0000DF40 0000004C .text   .text    (psp_twrk60n512.a cortex_boot.o  )
  0000DF40 0000004C .text   _@DummyFn1    (psp_twrk60n512.a cortex_boot.o  )
  0000DF40 00000000 .text   __boot    (psp_twrk60n512.a cortex_boot.o  )
  0000DF7A 00000000 .text   __set_MSP    (psp_twrk60n512.a cortex_boot.o  )
  0000DF80 00000000 .text   $d    (psp_twrk60n512.a cortex_boot.o  )
  0000DF8C 00000058 .text   _cortex_int_init    (psp_twrk60n512.a cortex.o       )

.

.

.

.

 

# .main_application_data
#>1FFF0000          __VECTOR_TABLE_RAM_START (linker command file)
  1FFF0000 00000418 .vectors_ram ram_vector    (bsp_twrk60n512.a vectors.o      )
  1FFF0000 00000000 .vectors_ram .vectors_ram    (bsp_twrk60n512.a vectors.o      )
#>1FFF0600          __BDT_BASE (linker command file)
#>1FFF0600          __BDT_END (linker command file)
#>1FFF0600          __START_DATA (linker command file)
  1FFF0600 00000007 .data   @157    (i2c.obj)
  1FFF0607 00000020 .data   @158    (i2c.obj)
  1FFF0627 00000011 .data   @159    (i2c.obj)
  1FFF0638 00000009 .data   @224    (rtc.obj)

.

.

.

.

 

and the "save" command is in the script ..

 

#define FAPP_CFG_TFTPS_AFTER_WRITE_REQUEST_SCRIPT   "set boot go; save; go"

 

 

 

0 Kudos

499 Views
matute
Contributor III

I see a difference between your .xMap and .xMap of AN4367:

 

your .xMap

#>0000C000          __VECTOR_TABLE_ROM_START (linker command file)
  0000C000 00000400 .vectors_rom rom_vector    (bsp_twrk60n512.a vectors.o      )
  0000C000 00000000 .vectors_rom .vectors_rom    (bsp_twrk60n512.a vectors.o      ) 

 

AN4367 .xMap

#>0000C000          __VECTOR_TABLE_ROM_START (linker command file)
  0000C000 00000410 .vectors_rom rom_vector    (bsp_twrk60n512.a vectors.o      )
  0000C000 00000000 .vectors_rom .vectors_rom    (bsp_twrk60n512.a vectors.o      )

 

See your lcf if you realy define this line

 

vectorrom   (RX): ORIGIN = 0x0000C000, LENGTH = 0x00000410

 

It seem that you have LENGTH = 0x00000400 at this line of lcf

 

Matt

 


0 Kudos

499 Views
monXii
Contributor III

yeah .. i saw this too..

 

but its defined like AN ..

 

fnet_bootloader  (RX) : ORIGIN = 0x00000000, LENGTH = 0x0000C000
vectorrom          (RX) : ORIGIN = 0x0000C000, LENGTH = 0x00000410
rom              (RX) : ORIGIN = 0x0000C420, LENGTH = 0x0007F000-0x0000C420

 

don't know why he only uses 0x400 bytes ..

 

and the ram vector table is 0x418 bytes big .. ?!

0 Kudos