Blinky no blink, but can step debug?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Blinky no blink, but can step debug?

Jump to solution
684 Views
user24601
Contributor II

LPC 1769 RevB, LPC Expresso v8.2.2 Build 650, Semihosted C

I have run the code below out to the 1769 using the attached programmer.  It worked once and then I could step into the code therafter, but the LED never lit again.  This example doesn't actually, blink, but should turn on the red LED.  I took the board to a friend, and he was able to get my blinky blinking using the LPC-Link2 programmer, so I bought one and it also is able to program the part and step into the code, but does not blink the light.  I tried to program the flash with mass erase and the ISPResetConnect.scp file which had no apparent effect on the problem.  I now have 4 boards with this issue, since I thought that I was damaging them until my friend's setup was able to revive them.  I also tried using the USB cable direct to the PC and to a different PC.  I am unable to find any references to this issue, since most of the reset type questions involve not being able to debug.  I have always been able to program and debug these parts.  Something is keeping the IO from working.

#ifdef __USE_CMSIS
#include "LPC17xx.h"
#endif

#include "board.h"
#include <cr_section_macros.h>

#include <stdio.h>
#define LED0_GPIO_PORT_NUM 0
#define LED0_GPIO_BIT_NUM 22

// TODO: insert other include files here

// TODO: insert other definitions and declarations here

int main(void) {

Chip_GPIO_WritePortBit(LPC_GPIO, LED0_GPIO_PORT_NUM, LED0_GPIO_BIT_NUM, 0);

//Board_LED_Set(0, !Board_LED_Test(0));
printf("Hello World\n");

// Force the counter to be placed into memory
volatile static int i = 0 ;
// Enter an infinite loop, just incrementing a counter
while(1) {
i++ ;
}
return 0 ;
}

0 Kudos
1 Solution
504 Views
user24601
Contributor II

I believe that my issue is resolved.  The blinky example doesn't set IOCON, which results in unpredictable behavior.  I've been trying to figure this out for hours, so hopefully this post will save someone else the trouble.

View solution in original post

0 Kudos
4 Replies
505 Views
user24601
Contributor II

I believe that my issue is resolved.  The blinky example doesn't set IOCON, which results in unpredictable behavior.  I've been trying to figure this out for hours, so hopefully this post will save someone else the trouble.

0 Kudos
504 Views
user24601
Contributor II

The board is the LPC 1769 Rev.B with the attached debugger.

Yes, the LPCOpen blinky examples build, program, debug, but do not blink.  I thought that the board was damaged somehow until my friend magically repaired it, only to be returned to the non-working state by programming it at home once again.

0 Kudos
504 Views
soledad
NXP Employee
NXP Employee

Hi,

Could you please try to switch on vector catch and try to switch to ISP as described in:

Regaining debug access to target MCU 

Then try again with the blinky example.

Have a great day,

Sol
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
504 Views
converse
Senior Contributor V

What board are you using? Your own, or a standard board?

Have you tried the standard LPCOpen blinky examples?

0 Kudos