0

A Bootloader and an application is working fine.

The bootloader loads the application, and then jumps into it.

The problem: I need to use different linker script to either have the app standalone or bootloader compatible.

I believe it is because the memory segment is not correctly defined for kseg0_program_mem, kseg0_boot_mem & kseg1_boot_mem.

//_RESET_ADDR                    = 0xBFC00000; <- work without bootloader
_RESET_ADDR                    = 0x9D000480; <- work with bootloader

[....]

MEMORY
{
  kseg0_program_mem     (rx)  : ORIGIN = 0x9D000000 + 0x800, LENGTH = 0x100000 - 0x800 
  kseg0_boot_mem              : ORIGIN = 0x9D000000, LENGTH = 0x0 
  debug_exec_mem              : ORIGIN = 0x9FC20490, LENGTH = 0x3B20
  kseg0_boot_mem              : ORIGIN = 0x9FC20490, LENGTH = 0x0
  kseg1_boot_mem              : ORIGIN = 0x9D000000, LENGTH = 0x480
  kseg1_boot_mem_4B0          : ORIGIN = 0xBFC004B0, LENGTH = 0x3B00
  config_BFC03FC0             : ORIGIN = 0xBFC03FC0, LENGTH = 0x4
Damien
  • 1,492
  • 10
  • 32
  • I don't think it is possible. Linker file determines where to place the code. It does not understant if bootloader is exist or not. Also you don't write code in linker file to understant bootloader. – Gürtaç Kadem Nov 23 '18 at 04:27
  • It was possible in PIC24, it the bootloader program just needed to change the reset address, but the boot sequence seems different on PIC32 – Damien Nov 23 '18 at 09:04

0 Answers0