• AVR Freaks

Hot!PIC32MZ bootlader Harmony (USB). Help with the ld file for application.

Page: < 12 Showing page 2 of 2
Author
Paul PortSol
Super Member
  • Total Posts : 471
  • Reward points : 0
  • Joined: 2015/07/03 11:52:03
  • Location: Newfoundland, Canada
  • Status: offline
Re: PIC32MZ bootlader Harmony (USB). Help with the ld file for application. 2019/07/05 04:42:56 (permalink)
0
Also the PIC32MZ page size is 4KB=0x1000 but yellow area in map above has boundaries between user and boot at 0x480 which won't work.
 
#21
DominusT
Super Member
  • Total Posts : 1322
  • Reward points : 0
  • Joined: 2005/07/22 08:31:18
  • Status: offline
Re: PIC32MZ bootlader Harmony (USB). Help with the ld file for application. 2019/07/05 05:18:46 (permalink)
0
Paul PortSol
* That memory map doesn't look right, what document did it come from?
 Paul


It is simply analyzed the btl_mz.ld file (blue color) of the bootloader of the Harmony example by calling Basic and the app_mz.ld file of the user application generated by MHC (yellow color).

I will attach two images of the ELFViewer tool where you can see both memories better.
#22
Paul PortSol
Super Member
  • Total Posts : 471
  • Reward points : 0
  • Joined: 2015/07/03 11:52:03
  • Location: Newfoundland, Canada
  • Status: offline
Re: PIC32MZ bootlader Harmony (USB). Help with the ld file for application. 2019/07/05 05:21:23 (permalink)
0
Best you look at the real datasheet for the chip you are using (code can have bugs).
That's why my ld files have some other areas blocked out.
Paul
#23
DominusT
Super Member
  • Total Posts : 1322
  • Reward points : 0
  • Joined: 2005/07/22 08:31:18
  • Status: offline
Re: PIC32MZ bootlader Harmony (USB). Help with the ld file for application. 2019/07/05 05:27:11 (permalink)
0
Paul PortSol
Best you look at the real datasheet for the chip you are using (code can have bugs).
That's why my ld files have some other areas blocked out.
Paul


Yes,  I have analyzed it, and if I'm not mistaken, the bootloader is in an area called Lower_ Boot_ Alias and that doesn't invade a subarea called Configuration Space.
#24
DominusT
Super Member
  • Total Posts : 1322
  • Reward points : 0
  • Joined: 2005/07/22 08:31:18
  • Status: offline
Re: PIC32MZ bootlader Harmony (USB). Help with the ld file for application. 2019/07/05 05:41:26 (permalink)
0
Paul PortSol
Best you look at the real datasheet for the chip you are using (code can have bugs).
That's why my ld files have some other areas blocked out.
Paul


Regarding the bootloader, it can be seen that it goes from 0x1FC00000 to before 0x1FC09800 inside the Lower Boot Alias and before Configuration Space (0x1FC0FF00 to 0x1FC1000)




Attached Image(s)

#25
DominusT
Super Member
  • Total Posts : 1322
  • Reward points : 0
  • Joined: 2005/07/22 08:31:18
  • Status: offline
Re: PIC32MZ bootlader Harmony (USB). Help with the ld file for application. 2019/07/05 05:49:14 (permalink)
0
Regarding the user application it starts at 0x1D00_0000 (.reset) and .dint starts at 0x1D00_0480.


I have modified that has value bigger, for example that .dinit starts at 0x0x1D00_1000 (and obviously the jump address in the bootloader must be at that new value), but the problem is the same


Also attach in a single project the bootloader and the application and when debugging and keeping the pushbutton pressed, the bootlader is executed and debugged and when only the jump command is sent vía USB it jumps to the user application and the user apps works without problems.



post edited by DominusT - 2019/07/05 05:50:38

Attached Image(s)

#26
DominusT
Super Member
  • Total Posts : 1322
  • Reward points : 0
  • Joined: 2005/07/22 08:31:18
  • Status: offline
Re: PIC32MZ bootlader Harmony (USB). Help with the ld file for application. 2019/07/05 08:54:39 (permalink)
0
Paul PortSol
Best you look at the real datasheet for the chip you are using (code can have bugs).
That's why my ld files have some other areas blocked out.
Paul


I have made several tests unifying the user application and the bootloader.


I made my own Visual C # application and I can send the bootloader commands, for example I can send the jump command to the user application or check program memory without having to delete and program the memory of the MCU.


When I send the verify or jump command to the unified project, they work without problem.


That implies that the limits defined in the ld file are fine, the problem lies in writing the program memory by the bootloader. I think it's doing it elsewhere, without taking into account the limits set in the system_config.h () file and writing in a wrong position.



#27
Paul PortSol
Super Member
  • Total Posts : 471
  • Reward points : 0
  • Joined: 2015/07/03 11:52:03
  • Location: Newfoundland, Canada
  • Status: offline
Re: PIC32MZ bootlader Harmony (USB). Help with the ld file for application. 2019/07/08 04:38:32 (permalink)
0
Sounds like you'll have to dig in and debug it.
- add printfs showing memory address, and contents before/after each block write
- carefully verify that the whole block is written exactly (2K in PIC32MZ)
 
I can only guess but possibly a mixup in the virtual/physical addresses, or in the source/destination addresses.
 
#28
Page: < 12 Showing page 2 of 2
Jump to:
© 2019 APG vNext Commercial Version 4.5