Skip to main content
Visitor II
October 15, 2020
Question

Cannot run the BlueCoin SD demos

  • October 15, 2020
  • 3 replies
  • 2145 views

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();
 }
 }
 }
 }
 }
 
}

    This topic has been closed for replies.

    3 replies

    ST Employee
    October 16, 2020

    Hi @frnt​ ,

    As first tentative, you can check if the SD card on your BlueCoin is correctly formatted.

    Referring to the user manual UM2249, I suggest you to consider this sentence:

    The SD card is not provided in the package: you have to use an SDHC (Secure Digital High Capacity) Class 10 card and it must be formatted with the FAT32 file system (eg. by using SD Formatter tool).

    Please let me know if this can be of any help.

    -Eleon

    frntAuthor
    Visitor II
    October 16, 2020

    Thanks @Eleon BORLINI​  for your replay.

    Yes, I have tried with SD card class 10 correctly formatted with FAT32 file system.

    I have tried to identify the error code returned by the f_open function. The f_open returns FR_DISK_ERR.

    However, the SD card perfectly works. Could it be related to an hardware fault?

    I just want to understand if a have to return the board or not since it is new.

    Thanks in advance.

    ST Employee
    October 16, 2020

    Hi @frnt​ ,

    uhm... is it possible for you to check the same with another SD card...?

    -Eleon

    frntAuthor
    Visitor II
    October 16, 2020

    Hi @Eleon BORLINI​ ,

    yes I have tried two SD cards fat32 formatted and showed the same problem.

    Is there a way to use the debugger with the CoreSystem mounted on the Cradle?

    frntAuthor
    Visitor II
    November 5, 2020

    Dear @Eleon BORLINI​ ,

    I had to send the board back to seller because it was broken.

    Best regards.