cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot run the BlueCoin SD demos

frnt
Senior

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

12 REPLIES 12
Eleon BORLINI
ST Employee

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

frnt
Senior

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.

Hi @frnt​ ,

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

-Eleon

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?

Hi @frnt​ ,

currently asking for help to internal experts.

I see that in the UM2249 (paragraph 2.5.1 Audio_SD) it is suggested that:

To open the file and start saving the audio file [on the SD card], you have to push the SW2 button on the BlueCoin: the LED blinking means the .wav file has been created and the recording has been initialized.

Did you performed this step?

-Eleon

Hi @Eleon BORLINI​ ,

this is exactly what I did. Indeed, just after pressing the SW2 button, the code loops forever in the while loop at line 74 of the example application.

It would be great to have the possibility to debug also Applications that make use of the cradle board, otherwise it is really a nightmare to program the CoreSystem on the CoinStation and later mount it on the cradle.

Best,

Hi @frnt​ ,

you are right

I would suggest two other tests:

  • First, check if you performed this step described in the UM2249 "To stop the acquisition, you have to push the BlueCoin button once again.". But maybe the physical interrupt of SW2 button is not exiting the while loop, because it is not receiving it (but the bottom is ok since the acquisition starts running). Please check also if something is saved on the SD card.
  • Second, you can try to run the DataLog example instead of the AudioSD one: in this way, you would check if there is some issue in the SDIO connection between the BlueCoin and the Cradle, by selecting the operating mode LoggingInterface = SDCARD_Datalog, i.e. the sensors (not the audio, so other sensors except the microphone) raw data storage on SD card.

-Eleon

Hi @Eleon BORLINI​ ,

I have tried first the AudioSD as you have suggested but nothing is saved on the SD card.

I have also tried the DataLog example with SDCARD operating mode, but also in this case I don't see anything on the SD card.

Is there a way to start a debug session when both the CoreSystem and the Cradle are connected?

Best

Hi @frnt​ ,

I checked internally and it is possible to debug the cradle + the bluecoin module (i.e. STEVAL-BCNCS01V1 + STEVAL-BCNCR01V1).

On the cradle module (STEVAL-BCNCR01V1) you have to physically wire the SWD pins shown below, that you can also find on p.3 of the schematic:

0693W0000058vQlQAI.png 

-Eleon