the hardware seting for LPC4370 boards is good, but I still can't make the led blink.

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

the hardware seting for LPC4370 boards is good, but I still can't make the led blink.

297 Views
chenghaoliu
Contributor I

47d73e946e7d57c5c1b6b6da3add3bc.jpg

189e90021e214b0b08ae2cefe6c3b3f.jpg

I think my hardware setting is correct. WHY my  debugging board Connect with the computer  USB is always blink and never stop? and the other target board doesn't blink?

chenghaoliu_0-1724215613180.pngchenghaoliu_1-1724215662011.png

chenghaoliu_2-1724215720248.png

I only include lpc_chip_43xx and lpc_board_nxp_lpclink2_4370.

and below is my code for blink projet :

#include "board.h" // 确保包含了 board.h 以便能够访问板级 API

 

void delay(int count) {

volatile int i;

for (i = 0; i < count; i++) {

__asm volatile ("nop");

}

}

 

int main(void) {

 

#if defined (__USE_LPCOPEN)

// 读取时钟设置并更新 SystemCoreClock 变量

SystemCoreClockUpdate();

#if !defined(NO_BOARD_LIB)

#if defined (__MULTICORE_MASTER) || defined (__MULTICORE_NONE)

// 设置并初始化与板硬件相关的所有必要块和函数

Board_Init();

#endif

// 将 LED 设置为“开”状态

Board_LED_Set(0, true);

#endif

#endif

 

// 闪烁 LED 三次

for (int j = 0; j < 3; j++) {

Board_LED_Set(0, false); // 关闭 LED

delay(1000000); // 延迟以使 LED 关闭状态可见

Board_LED_Set(0, true); // 打开 LED

delay(1000000); // 延迟以使 LED 打开状态可见

}

 

// 将 LED 恢复到初始状态

Board_LED_Set(0, true);

 

// 进入一个无限循环

while(1) {

// 可以在此处添加其他代码,或保持LED处于静止状态

__asm volatile ("nop");

}

 

return 0;

}

what I could do?

I want the led blink 3 times and keeps lighting, but why my traget board

is always lighting and my debug board is flashing all the time?

I once always connect only one board with my computer, I know it's wrong now.

0 Kudos
Reply
3 Replies

257 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that you use LPCOpen example called periph_blinky.

In the example, the systick module is used to generate fixed time interrupt, in the ISR, the LED is toggled.

This is the code:

static uint32_t tick_ct = 0;

void SysTick_Handler(void)

{

tick_ct += 1;

if ((tick_ct % 50) == 0) {

Board_LED_Toggle(0);

}

}

 

int main(void)

{

 

SystemCoreClockUpdate();

Board_Init();

 

/* Enable and setup SysTick Timer at a periodic rate */

SysTick_Config(SystemCoreClock / TICKRATE_HZ);

..............

}

 

Yhat is why the LED is always toggle. If you do not want to toggle LED, just comment

the line Board_LED_Toggle(0); in void SysTick_Handler(void).

Pls check if it is your case.

 

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply

267 Views
chenghaoliu
Contributor I
The jumpers of JP1 and JP2 of the debug board are connected, and the evaluation board and debug board are connected correctly.
When I connected the computer's USB port before, the LED of my debug board was flashing obviously, while the LED of my evaluation board was always on.
I suspect that I mistakenly connected only a single board for programming before, which caused the code I wrote to make it flash [and also reported the error of Unable to connect wire for probe index 1. target connected], and then it kept flashing.
I just used lpcscrypt to update its firmware. Now when debugging, I found the Jlink probe, which was originally LPC-LINK2 CMSIS-DAP V5.460. After I updated the firmware, the flashing of the LED of this debug board was not very obvious, and it became a slight flash, like a constant.
But when I changed the state of the LED in the code to always off. The LED of this debug board did not go out, but flashed a few times slightly faster and then continued to be on. When I tested other flashing codes, the LED of this debug board was the same.
I suspect that my debug board is broken because of my previous misoperation. Could you please give me some advice? Thank you.
0 Kudos
Reply

256 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls check if you can download application to the evaluation board, if you can download, it means that the debug board is okay.

Hope it can help you

BR

Xiangjun Rong

0 Kudos
Reply