• 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 : 535
  • 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 : 1372
  • 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 : 535
  • 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 : 1372
  • 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 : 1372
  • 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 : 1372
  • 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 : 1372
  • 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 : 535
  • 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
DominusT
Super Member
  • Total Posts : 1372
  • 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/10/08 19:32:30 (permalink)
0
Hi.
 
Finally, MCHP sent me a bootloader example to compare with mine.

I let MCHP answer me when they can, since that functionality is going to be integrated into our product at the end, for the moment it is still under development.


The example of MCHP has the Dynamic Flash ECC property in OFF_UNLOCKED while I had it ON.

I wanted to use that property to avoid a possible error of reading the program memory by the CPU in an industrial noise environment, in a nutshell to make the product more robust in an industrial environment.

The only worrying thing is the delay by the technical service, fortunately we were not in an urgent situation.
#29
Soren.Bang
Starting Member
  • Total Posts : 45
  • Reward points : 0
  • Joined: 2012/10/10 13:01:51
  • Location: Denmark
  • Status: offline
Re: PIC32MZ bootlader Harmony (USB). Help with the ld file for application. 2019/10/17 09:25:15 (permalink)
0
Dear Dominus
 
I have a project based on a PIC32MX230H128 with a USB bootloader - I know it's a different processor series but you may be able to make some of it anyway.
 
I have attached the linker script files for the bootloader btl_mx.ld, the application app_mx.ld and the application without bootloader (we use it for debugging) no_btl_mx.ld.
 
Regards
 
Søren
#30
DominusT
Super Member
  • Total Posts : 1372
  • 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/10/17 09:28:45 (permalink)
0
Soren.Bang
Dear Dominus
 
I have a project based on a PIC32MX230H128 with a USB bootloader - I know it's a different processor series but you may be able to make some of it anyway.
 
I have attached the linker script files for the bootloader btl_mx.ld, the application app_mx.ld and the application without bootloader (we use it for debugging) no_btl_mx.ld.
 
Regards
 
Søren


Are you using Harmony to generate the bootloader and the user application?
#31
DominusT
Super Member
  • Total Posts : 1372
  • 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/10/17 09:35:35 (permalink)
0
Soren.Bang
Dear Dominus
 
I have a project based on a PIC32MX230H128 with a USB bootloader - I know it's a different processor series but you may be able to make some of it anyway.
 
I have attached the linker script files for the bootloader btl_mx.ld, the application app_mx.ld and the application without bootloader (we use it for debugging) no_btl_mx.ld.
 
Regards
 
Søren



I managed to work with the bootloader of the PIC32MX795F512H with RS232 and Ethernet before Harmony, I don't find the related threads, this is one of them, maybe it will be useful:

https://www.microchip.com...851.aspx?high=DominusT
#32
Soren.Bang
Starting Member
  • Total Posts : 45
  • Reward points : 0
  • Joined: 2012/10/10 13:01:51
  • Location: Denmark
  • Status: offline
Re: PIC32MZ bootlader Harmony (USB). Help with the ld file for application. 2019/10/17 09:47:13 (permalink)
0
Yes I am - The bootloader it self is from the harmony example with an input as the trigger - It simply detects that the USB cable is supplying the power to the board.
 
And the app_mx.ld is used with a harmony (1.06) project.
 
We have used it for a couple of years and it seems to work well.
 
Søren
#33
DominusT
Super Member
  • Total Posts : 1372
  • 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/10/17 09:50:50 (permalink)
0
But what exactly is your problem? What is not working?
#34
Soren.Bang
Starting Member
  • Total Posts : 45
  • Reward points : 0
  • Joined: 2012/10/10 13:01:51
  • Location: Denmark
  • Status: offline
Re: PIC32MZ bootlader Harmony (USB). Help with the ld file for application. 2019/10/17 10:25:33 (permalink)
0
No problem - it is working as it should - Did you manage to get your bootloader for the MZ to load the application code correctly ?
#35
Page: < 12 Showing page 2 of 2
Jump to:
© 2019 APG vNext Commercial Version 4.5