Hi, My problem is simple- Recently I just start play with FRDM-MCXN947 board. According to tutorial I create C project file. My first test should be Green color simple on and off (onboard RGB led) . Program written by me looks like that:
while(1) {
i++ ;
if(i==1){
GPIO_PortSet(BOARD_INITDEBUG_UARTPINS_LED_GREEN_PORT, BOARD_INITDEBUG_UARTPINS_LED_GREEN_PIN_MASK);
}
if(i==20000000){
GPIO_PortClear(BOARD_INITDEBUG_UARTPINS_LED_GREEN_PORT, BOARD_INITDEBUG_UARTPINS_LED_GREEN_PIN_MASK);
}
if(i==40000000){
i=0;
}
/* 'Dummy' NOP to allow source level single stepping of
tight while() loop */
__asm volatile ("nop");
}
I just did some changes (main source file) inside while loop and other part is not changed at all.
I try run debugging and GREEN led turn on but never turn off. Of course I did changes in required pin changes with integrated config tool. Also here printscreens from main source file, pinmux and config screens:
解決済! 解決策の投稿を見る。
Problem solved instead of this
BOARD_INITDEBUG_UARTPINS_LED_GREEN_PORT
use this:
BOARD_INITDEBUG_UARTPINS_LED_GREEN_GPIO
or this:
BOARD_INITLEDSPINS_LED_GREEN_GPIO
but why same defined twice with different names...?
Code after all changes:
while(1) {
i++ ;
if(i==1){
GPIO_PortSet(BOARD_INITLEDSPINS_LED_GREEN_GPIO, BOARD_INITLEDSPINS_LED_GREEN_PIN_MASK);
}
else if(i==2000000){
GPIO_PortClear(BOARD_INITLEDSPINS_LED_GREEN_GPIO, BOARD_INITLEDSPINS_LED_GREEN_PIN_MASK);
}
else if(i==4000000){
i=0;
}
/* 'Dummy' NOP to allow source level single stepping of
tight while() loop */
__asm volatile ("nop");
}
Those files already included trought board.h (at least I think so):
And bdw all project files is automatically generated. And my opinion all necessary files and includes should be inside.
gpio driver version 2.7.3:
Are you using SDK 2.5? If i remember correctly, fsl_gpio.h PortClear and PortSet has 3 arguments. verify your version of gpio driver you are using
Problem solved instead of this
BOARD_INITDEBUG_UARTPINS_LED_GREEN_PORT
use this:
BOARD_INITDEBUG_UARTPINS_LED_GREEN_GPIO
or this:
BOARD_INITLEDSPINS_LED_GREEN_GPIO
but why same defined twice with different names...?
Code after all changes:
while(1) {
i++ ;
if(i==1){
GPIO_PortSet(BOARD_INITLEDSPINS_LED_GREEN_GPIO, BOARD_INITLEDSPINS_LED_GREEN_PIN_MASK);
}
else if(i==2000000){
GPIO_PortClear(BOARD_INITLEDSPINS_LED_GREEN_GPIO, BOARD_INITLEDSPINS_LED_GREEN_PIN_MASK);
}
else if(i==4000000){
i=0;
}
/* 'Dummy' NOP to allow source level single stepping of
tight while() loop */
__asm volatile ("nop");
}