View previous topic :: View next topic |
Author |
Message |
soonc
Joined: 03 Dec 2013 Posts: 215
|
PIC24 and V5.048 blues |
Posted: Sun Aug 09, 2015 4:25 pm |
|
|
Compiler: V5.048
Using CCS IDE also 5.048
Chip: 24FJ128GA306.h
Trying to get two breakpoints in my code to work.
I wrote this simple code to illustrate the problem.
In this example in main() I set two break.
The code stops at BP #1 but ignores BP#2
I do Clean and remove all compiled files, recompile, load and then set BP#2 only it still ignores BP#2
Is this a known issue ?
Is it me or the IDE ?
Getting started with PIC24 and CCS is difficult.
The Old IDE (V4.1xx) had nice feature this new IDE is not so nice.
No description about fuses. Yes I know about fuses.txt but the old IDE had a windows that sorted out which ones are valid for the particular chip. I did not see that on the 5.048 IDE !
Code: |
#include <24FJ128GA306.h>
#device adc=12
#build (stack=512)
#device ICD=TRUE
#device ICSP=2
#use delay(clock=29491200, crystal=7372800)
#ZERO_RAM
#FUSES NOWDT //No Watch Dog Timer
#FUSES NOJTAG //JTAG disabled
#FUSES CKSFSM //Clock Switching is enabled
//////////////////////////////////////////////////////////////////////
//
void main()
{
char BreakPointUseOnly;
output_high(PIN_F0);
BreakPointUseOnly=0; // Break point #1
output_low(PIN_B10);
BreakPointUseOnly=0; // Break point #2
while(1)
{
delay_ms(1000);
output_toggle(PIN_B5);
}
} // end main()
|
|
|
|
jeremiah
Joined: 20 Jul 2010 Posts: 1349
|
|
Posted: Sun Aug 09, 2015 5:11 pm |
|
|
the IDE still shows the configuration bits/fuses with descriptions. It should be in one of the ribbons. I want to say it is the View ribbon (I don't have the IDE in front of me). Look for the Configuration Bits button on the leftish side (smaller button on the ribbon).
I don't generally use the debugger, so I can't help there. |
|
|
soonc
Joined: 03 Dec 2013 Posts: 215
|
Yes there it is |
Posted: Sun Aug 09, 2015 5:51 pm |
|
|
jeremiah wrote: | the IDE still shows the configuration bits/fuses with descriptions. It should be in one of the ribbons. I want to say it is the View ribbon (I don't have the IDE in front of me). Look for the Configuration Bits button on the leftish side (smaller button on the ribbon).
I don't generally use the debugger, so I can't help there. |
Thanks I don't use the Ribbon, I did enable it and found the Config Bits screen. I was looking for the "Valid Fuses" that the old IDE used to call Config Bits. !
So that helps a lot Thanks, but I still can't set a second break point ! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Mon Aug 10, 2015 12:55 am |
|
|
Try setting 'BreakPointUseOnly' to 1 the second time.
I'd suspect the line is being optimised away. The compiler knows the variable has already been set to 0, so removes the second line.... So there is no code there to actually break at. |
|
|
soonc
Joined: 03 Dec 2013 Posts: 215
|
|
Posted: Mon Aug 10, 2015 7:09 am |
|
|
Ttelmah wrote: | Try setting 'BreakPointUseOnly' to 1 the second time.
I'd suspect the line is being optimised away. The compiler knows the variable has already been set to 0, so removes the second line.... So there is no code there to actually break at. |
Good thought but no luck there:
The .lst file shows code for each location.
I added a third breakpoint and it still only stops on the first.
Code: |
.................... char BreakPointUseOnly;
....................
.................... output_high(PIN_F0);
00238: BCLR.B 2E8.0
0023A: BSET.B 2EC.0
....................
.................... BreakPointUseOnly=0; // Break point #1
0023C: CLR.B 85C
....................
.................... delay_ms(1000);
0023E: MOV #3E8,W0
00240: CALL 200
....................
.................... output_low(PIN_B10);
00244: BCLR.B 2C9.2
00246: BCLR.B 2CD.2
....................
.................... BreakPointUseOnly++; // Break point #2
00248: INC.B 085C
....................
.................... delay_ms(1000);
0024A: MOV #3E8,W0
0024C: CALL 200
....................
.................... BreakPointUseOnly++; // Break point #3
00250: INC.B 085C
....................
.................... delay_ms(1000);
00252: MOV #3E8,W0
00254: CALL 200
|
|
|
|
soonc
Joined: 03 Dec 2013 Posts: 215
|
Update and work around |
Posted: Wed Aug 12, 2015 8:38 pm |
|
|
Setting more than one break point (BP) causes problems.
When using the IDE in debug mode you need to Load the code and "Clear All BP's" on the Break Point menu.
then set ONE BP.
If you need to set more than one BP:
Set the first BP when the code stops.
CLEAR that BP, and then set the second BP.
Essentially the trick is to only use one BP and after loading changed code CLEAR all BP's and then set the first BP.
I have a service request in with CCS hopefully a fix will happen soon to allow more than one BP. |
|
|
dish_moose
Joined: 06 Oct 2006 Posts: 13
|
Re: Update and work around |
Posted: Wed Dec 02, 2015 5:01 pm |
|
|
soonc wrote: | Setting more than one break point (BP) causes problems.
When using the IDE in debug mode you need to Load the code and "Clear All BP's" on the Break Point menu.
then set ONE BP.
If you need to set more than one BP:
Set the first BP when the code stops.
CLEAR that BP, and then set the second BP.
Essentially the trick is to only use one BP and after loading changed code CLEAR all BP's and then set the first BP.
I have a service request in with CCS hopefully a fix will happen soon to allow more than one BP. |
Has this been fixed _ I'm going crazy trying to debug code with only being able to set 1 Break at a time.
-Bruce |
|
|
|