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?
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.
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
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