Hi jingpan, I have got the ksdk 2.3 working, but my HM-10 is still not responding with this board. I am using the following code:
#include "board.h"
#include "fsl_lpuart.h"
#include "fsl_device_registers.h"
#include "fsl_debug_console.h"
#include "pin_mux.h"
#include "clock_config.h"
#define DEMO_LPUART LPUART0
#define DEMO_LPUART_CLKSRC SYS_CLK
#define DEMO_LPUART_CLK_FREQ CLOCK_GetFreq(SYS_CLK)
uint8_t txbuff[] = "AT";
uint8_t rxbuff[100];
int main(void)
{
lpuart_config_t config;
BOARD_InitPins();
BOARD_BootClockRUN();
CLOCK_SetLpuart0Clock(0x1U);
BOARD_InitDebugConsole();
LPUART_GetDefaultConfig(&config);
config.baudRate_Bps = 9600;
config.enableTx = true;
config.enableRx = true;
LPUART_Init(DEMO_LPUART, &config, DEMO_LPUART_CLK_FREQ);
LPUART_WriteBlocking(DEMO_LPUART, txbuff, sizeof(txbuff) - 1);
LPUART_ReadBlocking(DEMO_LPUART, rxbuff, sizeof(rxbuff) - 1);
PRINTF("Response:\n");
PRINTF("%d\n", rxbuff);
}
But I am not getting any reply (even with "AT\r\n"), and any code after ReadBlocking does not read out.
Do I not also have to specify which pins I am using for RX/TX (PTB2/PTB1)? Not sure how to do that.
Thanks for any response, I am a complete newbie to this.