Cannot run the BlueCoin SD demos
Hello,
I have recently bought the BlueCoin kit. I have tried some of the demo project from the software library STSW-BCNKT01_V2.3.0, by directly dragging the .bin file into the Nucleo 64 board icon.
I'm experiencing issues with SD card demos, where the CoreSystem after programming needs to be connected to the Cradle board.
In these demos, as an example the SD_Audio, the function DATALOG_SD_Log_Enable() returns always 0, getting the application stuck in the else statement:
Why is this happening? The SD card is mounted, but the f_open or the f_write fails...
I have tried with a 32GB microSD card Fatfs formatted. It is an hardware fault or the is a bug in the ST demo?
Thanks in advance
int main(void)
{
/* STM32F4xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 180 MHz */
SystemClock_Config();
/* Initialize LED */
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
BSP_LED_Init(LED4);
BSP_LED_Init(LED5);
BSP_LED_Init(LED6);
BSP_LED_Init(LED7);
BSP_LED_Init(LED8);
BSP_PB_Init(BUTTON_2, BUTTON_MODE_EXTI);
HAL_NVIC_SetPriority((IRQn_Type)EXTI1_IRQn, 0xFF, 0);
HAL_NVIC_EnableIRQ((IRQn_Type)EXTI1_IRQn);
HAL_Delay(100);
BSP_SD_Detect_Init();
while(!BSP_SD_IsDetected())
{
/* Go to Sleep */
__WFI();
}
BSP_LED_On(LED6);
HAL_Delay(2000);
BSP_LED_Off(LED6);
HAL_Delay(200);
DATALOG_SD_Init();
HAL_Delay(200);
/* Configure Audio Input peripheral - I2S*/
MicParams.BitsPerSample = 16;
MicParams.ChannelsNbr = AUDIO_CHANNELS;
MicParams.Device = AUDIO_IN_DIGITAL_MIC;
MicParams.SampleRate = AUDIO_SAMPLING_FREQUENCY;
MicParams.Volume = AUDIO_VOLUME_INPUT;
BSP_AUDIO_IN_Init(BSP_AUDIO_IN_INSTANCE, &MicParams);
/* Start Microphone acquisition */
BSP_AUDIO_IN_Record(BSP_AUDIO_IN_INSTANCE, (uint8_t *) PDM_Buffer, 0);
BSP_LED_On(LED2);
while (1)
{
if(BUTTONInterrupt)
{
BUTTONInterrupt = 0;
if (SD_Log_Enabled)
{
SD_Log_Enabled = 0;
DATALOG_SD_Log_Disable();
BSP_LED_Off(LED4);
}
else
{
while(SD_Log_Enabled != 1)
{
if(DATALOG_SD_Log_Enable())
{
SD_Log_Enabled = 1;
}
else
{
DATALOG_SD_Log_Disable();
}
}
}
}
}
}