Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using ds30 Loader in Conjunction with AN-1095 EEPROM Emulation [solved]
#1
I have a couple of similar projects, one using a PIC24FJ with the ds30 loader, another with dsPIC33FJ and EEPROM emulation (AN-1095).

I want to end up with both projects using both ds30 loader and EEPROM emulation. What is the best way to acheive this?

I think I need to reserve an additional 2 pages of flash before the bootloader.

Therefore for the PIC24FJ device my final 4 pages of memory will be :-
EEPROM
EEPROM
BOOT
BLANK + CONFIG

I guess I have two questions here,
1. How do I make the compiler place the two EEPROM pages in the right place?
2. How do I ensure the ds30 loader GUI does not over write the last 4 pages? Is it as simple as entering the Advanced tab, ticking the Custom Bootloader check box and changing number to 4 pages?
Reply
#2
1. Isn't that at setting in the code?
2. ds30 Loader doesn't need to know about it. Just don't place the boot loader or the application where the "eeprom" is located. Possibly by reserving the space in the linker script.
Reply
#3
Well I got this all working in the end.

I would recomend modifying the linker script. It is important to remember to reserve the 4 addresses in the page BEFORE the bootloader, as the goto UserApp is placed there. That means most of the page with the goto UserApp in is available, but it is not suitable for use as an EEPROM page. So the last EEPROM page is best located 2 pages before the first page of the boot loader.

It is best to fix the address of the EEPROM pages, so modify the line in "DEE Emulation 16-bit.c"
from
__attribute__ ((space(psv), aligned(NUMBER_OF_INSTRUCTIONS_IN_PAGE * 2), noload));
to
__attribute__ ((space(psv), aligned(NUMBER_OF_INSTRUCTIONS_IN_PAGE * 2), address(EE_START_ADDR), noload));

Finally I was surprised to see the contents of my EEPROM pages preserved between firmware updates. I guess the ds30 Loader GUI or hex file does not contain instructions for programming these areas of "noload" flash.

Very pleased with the result!
Reply
#4
Hello,
with interest I read your success with the EEPROM. I would also use this boot loader in conjunction with a virtual EEPROM.What is still unclear to me now, I need to adjust the linker script or reaches a fixed set address of the EEPROM area?Thank you ever for a response.Greeting Gerhard
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)