CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

[BUG] ICD-U80: Erase only blocks -> No Chip Selected

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
allenhuffman



Joined: 17 Jun 2019
Posts: 537
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

[BUG] ICD-U80: Erase only blocks -> No Chip Selected
PostPosted: Tue Nov 05, 2019 1:16 pm     Reply with quote

ICD-U80: "Erase only blocks in hex file" -> No Chip Selected

I am trying to load code into a specific portion of the PIC24 memory (24EP256GP202), and I found the CCS Device Programmer option for "Erase only blocks on hex file." When I first tried it, it was wiping out the other code areas when I loaded a new area.

However, once I click this option (Device -> Options expand), I get "No Chip Specified." If I try to manually select a target chip, it doesn't stick and that field is blank under Device -> Target Chip.

I am running Software 5.060, Firmware 3.40.

Any tips?
_________________
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 ?


Last edited by allenhuffman on Thu Nov 07, 2019 8:52 am; edited 1 time in total
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Wed Nov 06, 2019 1:27 am     Reply with quote

Now you say that 'erase only blocks' was erasing other things. You do
realise that an erase block on this chip is 4KB?. So a lot of 'other things'
will be erased....
Is the chip attached?. The chip is normally filled in automatically.
allenhuffman



Joined: 17 Jun 2019
Posts: 537
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

PostPosted: Wed Nov 06, 2019 9:17 am     Reply with quote

Ttelmah wrote:
Now you say that 'erase only blocks' was erasing other things. You do
realise that an erase block on this chip is 4KB?. So a lot of 'other things'
will be erased....
Is the chip attached?. The chip is normally filled in automatically.


Yes, chip is attached just like normal. If I reset the tool back to defaults, everything works. As soon as I click that box, it won't work.

Yes, I am aware of block sizes and such, but it's good to have a mention of that in case others stumble upon that and find this post.

What I mean is, I put something in flash at 0x4000 and noticed stuff at 0x0 was blank. :-) That's when I realized updating erased everything before it started, and went to see if I could change that. I found that change option, and found it prevented me from doing anything once I clicked it.
_________________
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 ?
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Wed Nov 06, 2019 9:25 am     Reply with quote

That may be specific to the U80. Will go and have a play.
I've found before that some features are not supported by some programmers.
The U80 does it's programming by loading an 'executive' program into the
chip that is then used to perform the physical transfer and programming.
I know that on the Mach-X I've used the option to disable the full erase
merrily. I normally reserve the ICD's for debugging, so tend to not look
at this sort of thing....
allenhuffman



Joined: 17 Jun 2019
Posts: 537
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

PostPosted: Wed Nov 06, 2019 9:26 am     Reply with quote

Ttelmah wrote:
The U80 does it's programming by loading an 'executive' program into the
chip that is then used to perform the physical transfer and programming.


Interesting. Does this imply there are certain flash ranges that can't be programmed with this device?

In my case, I am trying to test a bootloader I wrote. I have some code at the start, and then want to load an "A" version of my app in one region, and a "B" version at another, then test the bootloader being able to select either one.

When I tried to load "A", it wiped out my bootloader code at the start ;-) which led me to creating this topic.
_________________
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 ?
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Thu Nov 07, 2019 2:28 am     Reply with quote

No, the executive is I think held in a small extra area of ROM. There is
space reserved for it on the PIC24.
Anyway, been testing this morning, and it is a fault with the current software.
I've used this mode in the past, and it now does not work. You should
report it to CCS.
Does the same thing on U80, U64, & Mach-X programmers.
Currently if you want to to leave an area unprogrammed, you have to
read it first and add it to what you program.... :(
allenhuffman



Joined: 17 Jun 2019
Posts: 537
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

PostPosted: Thu Nov 07, 2019 8:29 am     Reply with quote

Ttelmah wrote:
No, the executive is I think held in a small extra area of ROM. There is
space reserved for it on the PIC24.
Anyway, been testing this morning, and it is a fault with the current software.
I've used this mode in the past, and it now does not work. You should
report it to CCS.
Does the same thing on U80, U64, & Mach-X programmers.
Currently if you want to to leave an area unprogrammed, you have to
read it first and add it to what you program.... :(


Thank you for taking time to recreate the issue. I have a pending e-mail with them about this, and when they respond I will add additional notes about what you have also validated.
_________________
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 ?
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Thu Nov 07, 2019 9:22 am     Reply with quote

I've contacted them as well.
It's very strange. If you select the option, the programmer no longer seems
to talk to the chip at all.
You have always had to disable the configuration fuses option when this is
selected (these can only be cleared by a full erase), but something has
screwed it up completely.
allenhuffman



Joined: 17 Jun 2019
Posts: 537
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

PostPosted: Thu Jun 03, 2021 11:35 am     Reply with quote

Did this ever start working for anyone?

I am revisiting my Bootloader project and now see that when I have that option enabled, it no longer erases the entire chip, but also doesn't erase that flash page. It just tries to add new 0s on top of the existing 1s at that memory.

I've had a few dozen e-mail exchanged with CCS Support since yesterday about this, and they say they have one that works there, but the same .hex files and sources fail on mine.

Here's a tiny example that just attempts to make some code load at the start, then a second file that loads at 0x4200. It has some tweaks from CCS (like adding the HEXCOMMENT line to tell the hex file to erase or not erase--not working for me).

The end goal is to push first.c on the system via the IDE, and have it run. Then push second.c on the system and it should start with the first startup code then jump to the second main code (it would load and overwrite the "function()" code in first).

I've seen this work a few times, but not consistently. Some setting isn't sticking.

first.c:
Code:

// Erase entire flash part before programming Bootload code.
#HEXCOMMENT\SETTINGS OPTIONS=135 VOLTAGE=5.00
//MONITOR=38400

#include <24FJ256GA106.h>

//#device ICSP=TRUE
//#device ICD=3

#use delay(clock=32MHz,crystal=8MHz)
//#use rs232(ICD)

//#FUSES NOWDT                     //No Watch Dog Timer
//#FUSES CKSFSM                    //Clock Switching is enabled, fail Safe clock monitor is enabled
//#FUSES none
#FUSES NOPROTECT

#ORG 0x4000, 0x41FF {} // Skip relocated vector table area.

//#include <stdio.h>

#define LED_COM     PIN_B10
#define LED_FAULT   PIN_B11

#separate
void function();

void main(void)
{
    //printf ("Test "__DATE__" "__TIME__"\r\n");
   
    for (int idx=0; idx<3; idx++)
    {
        output_high (LED_COM);
        output_high (LED_FAULT);
        delay_ms (500);
        output_low (LED_COM);
        output_low (LED_FAULT);
        delay_ms (500);
    }
   
    delay_ms (1000);
   
    function();
   
    while(TRUE)
    {
        //TODO: User Code
    }
}

/*--------------------------------------------------------------------------*/
// This will be overwritten by the second .hex file.
/*--------------------------------------------------------------------------*/
#ORG 0x4200,0x427F
void function(void)
{
    //printf ("Bootloader.\r\n");

    while (TRUE)
    {
        output_high (LED_COM);
        delay_ms (100);
        output_low (LED_COM);
        delay_ms (100);
    }
}

// End of first.c


second.c:
Code:

// Only erase portion of flash being used in hex file.
#HEXCOMMENT\SETTINGS OPTIONS=139 VOLTAGE=5.00
//MONITOR=38400

#include <24FJ256GA106.h>

//#device ICSP=TRUE
//#device ICD=3

#use delay(clock=32MHz,crystal=8MHz)
//#use rs232(ICD)

//#FUSES NOWDT                     //No Watch Dog Timer
//#FUSES CKSFSM                    //Clock Switching is enabled, fail Safe clock monitor is enabled
#FUSES none
//#FUSES NOPROTECT

#BUILD (RESET=0x4000)
#BUILD (INTERRUPT=0x4000+0x8)
#ORG 0x0, 0x3FFF {}                         // Skip first part of flash.
#ORG 0x5000, getenv("PROGRAM_MEMORY")-1 {}  // Skip rest of flash.

#define LED_COM     PIN_B10
#define LED_FAULT   PIN_B11

//#include <stdio.h>

/*--------------------------------------------------------------------------*/
// This will override the function in the first .hex file.
/*--------------------------------------------------------------------------*/
#ORG 0x4200,0x427F
void main(void)
{
    //printf ("Application.\r\n");
   
    for (int idx=0; idx<10; idx++)
    {
        output_high (LED_FAULT);
        delay_ms (100);
        output_low (LED_FAULT);
        delay_ms (100);
    }
   
    reset_cpu ();
}

// End of second.c

_________________
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 ?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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