|
|
View previous topic :: View next topic |
Author |
Message |
allenhuffman
Joined: 17 Jun 2019 Posts: 552 Location: Des Moines, Iowa, USA
|
CCS Build & Run without erasing entire flash area. |
Posted: Tue Jun 01, 2021 11:51 am |
|
|
This is related to bootloader research I was doing in 2020:
http://www.ccsinfo.com/forum/viewtopic.php?t=55241
I have a CCS program that is my bootloader, which contains a stub app at memory 0x4000 (just blinking LEDs).
It can be loaded and will run the stub app just fine.
I then want to Build & Run a second project, which is the application code that should load at 0x4000 and do the real work.
After not getting this to work, I remembered the issue where it would first erase the flash part, wiping out the bootloader.
At the time, you could not do this manually in CCS Load. There was an option to NOT erase the flash, but CCS confirmed that it was not working. It may be now, but what we want to do is:
1) Build & Run the bootloader code (0x0000 - 0x3fff range, for example).
Then during development, we'd like to just:
2) Build & Run the application code (0x4000 - ???).
Doing step #2 erases everything from 0x0 to 0x3fff wiping out the bootloader.
I thought someone gave me a workaround two years ago but I haven't found the post yet.
Anyone recall? Or know how to do this? _________________ Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Tue Jun 01, 2021 2:54 pm |
|
|
Hmm....isn't there some 'FUSE' to write protect the bootloader segment of memory ? |
|
|
allenhuffman
Joined: 17 Jun 2019 Posts: 552 Location: Des Moines, Iowa, USA
|
|
Posted: Tue Jun 01, 2021 3:00 pm |
|
|
By default, CCS Load erases the entire memory first. There's a checkbox in the CCS load .exe to change this (which may or may not be fixed).
Support replied with this option:
Quote: | Add the command line option: MODE=MIN_ERASE
before the %h on the command line.
Use OPTIONS > IDE > TOOLS
to change the command line |
They had me do this to the "Program" button entry (there are two that use %H). That makes my command line look like:
Code: | "C:\Program Files (x86)\PICC\ccsload.exe" "MODE=MIN_ERASE" "-T" |
That does indeed let it not erase, but now I am having other issues where the data it is writing is not what I expect.
One step closer... _________________ Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Tue Jun 01, 2021 4:49 pm |
|
|
I don't use CCS Load,
but am concerned that the 'programmer' device OVERWRITES the actual program 'fuse' selections.
sounds like another 'wizard' that won't allow YOU to do what YOU want....
have to wonder what ELSE it's changing ..... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Wed Jun 02, 2021 2:24 am |
|
|
Obvious comment.
The 'second' program being loaded, should have:
#FUSES NONE
To ensure it does not override the existing fuses... |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Wed Jun 02, 2021 4:28 am |
|
|
ah but what if CCSLoad decides to add it's OWN fuses.....? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Wed Jun 02, 2021 6:17 am |
|
|
CCS_load, doesn't, unless you specifically change them.
Now, I'm not actually sure if he is using CCS_load 'directly', or via the
CCS IDE?. It does behave differently in the two cases. If you use CCS_load
'directly', the button to prevent erasing does work. However with a huge
'caveat', that if you load anything at all into a page, that whole page is erased.
It's only take something like a const stored near the bottom of memory, or
the delay code loaded down here, to result in the whole bottom page being
erased.
When instead you use it through the IDE, the program switches to a default
setting that CCS have selected. This does automatically erase the whole
memory. It is this that the command line option that the poster has been
given 'overrides'. Now, while CCS_Load (operated directly) will not set
default fuses, I don't know what it will do when driven from the IDE.
Would have to have a play with a chip and see. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|