cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo l010RB weird label and strange spi behavior

JAgue.1
Associate II

Hi,

I buy a new board L010RB, but it is labelled with classic strap "NUCLEO-L010RB" but there is one line after with is "NUL010RB$AU2". I had a couple of L010RB before but it's the first time i have such label on it.

IMG_20230906_082403.jpg

I'm wondering what is mean.

Plus I'm having some trouble with SD card / SPI. The card mount, open & read correctly the file but when it writes, it seems that after a couple of writing, it cannot write again in it nor open a new. I'm using FatFS with a code that i used before, and i never had a FR_DISK_ERR after some write.

Could it be linked to the weird label?

1 ACCEPTED SOLUTION

Accepted Solutions
JAgue.1
Associate II

Hi,

I finally solved my problem.

Since I did lots of tests to test the card and after that to recover my configuration, I could not said what exactly gone wrong with the error in the first place.

I can root for people how's having hard times with fatFS by SPI on a nucleo board. So in my previous post, i was upset because the tutorial linked doesn't work with the version of fatFS generated with MXCube (@ 13/09/2023, version: R0.12c), it never work for me, even after trying my best reading the original Korean post.

Instead, use this: https://01001000.xyz/2020-08-09-Tutorial-STM32CubeIDE-SD-card/

It require some debug effort by working with ffconfig.h or directly with the fatFS configuration on MXCube.

The SPI baudrate could be set much higher than 281 kbps so don't pay too much attention to that. And you should set off all configuration using GET_BLOCK_SIZE so set FF_MAX_SS == FF_MIN_SS (= 512 for me and lot of SD card just check the sector size of your card) or you could in user_diskio_spi.c at USER_SPI_ioctl add

 

 

// Line 506 user_diskio_spi.c
// Do it only if you know you sector size
// Or replace the case by something that send_cmd
// I don't know how to make it
// So good luck

case GET_SECTOR_SIZE:
*(WORD)buff = 512; // Put your sector size
break;

 

 

I recommend the first solution since it much more easy to change after that instead of hard coded .c line.

If you know how implement the GET_SECTOR_SIZE, i'm let me know it.

To make sure my SD is on correct format, i just free all its memory and use f_mkfs on it (Since i had FR_NO_FILESYSTEM error after some formatting).

I hope it would help some people trying their best on google research.

Best Regards.

Edit: I changed my card in the process.

 

 

View solution in original post

3 REPLIES 3
Issamos
Lead II

Hello @JAgue.1 

  • NUL010RB$AU2 is the Product order code.
  • For the SPI/SD card, I suggest you to look at this post.(video+description step by step).

Best regards.

II

Hi,

Ok for the product order code. By looking the left box of my others L010RB, I can saw that they are $AU1.

As i said my code for my SD card works fine on those card and for the $AU2 it can perform several file writing before the FR_DISK_ERR. So, i'm doubting about the fact that I need to remake that work with the fatfs generated code that need to be fix with some blog post 4 ~ 5 years old written in Korean.

Could it come from a clock pre-scaler that need to be change or something like that?

Best regards

JAgue.1
Associate II

Hi,

I finally solved my problem.

Since I did lots of tests to test the card and after that to recover my configuration, I could not said what exactly gone wrong with the error in the first place.

I can root for people how's having hard times with fatFS by SPI on a nucleo board. So in my previous post, i was upset because the tutorial linked doesn't work with the version of fatFS generated with MXCube (@ 13/09/2023, version: R0.12c), it never work for me, even after trying my best reading the original Korean post.

Instead, use this: https://01001000.xyz/2020-08-09-Tutorial-STM32CubeIDE-SD-card/

It require some debug effort by working with ffconfig.h or directly with the fatFS configuration on MXCube.

The SPI baudrate could be set much higher than 281 kbps so don't pay too much attention to that. And you should set off all configuration using GET_BLOCK_SIZE so set FF_MAX_SS == FF_MIN_SS (= 512 for me and lot of SD card just check the sector size of your card) or you could in user_diskio_spi.c at USER_SPI_ioctl add

 

 

// Line 506 user_diskio_spi.c
// Do it only if you know you sector size
// Or replace the case by something that send_cmd
// I don't know how to make it
// So good luck

case GET_SECTOR_SIZE:
*(WORD)buff = 512; // Put your sector size
break;

 

 

I recommend the first solution since it much more easy to change after that instead of hard coded .c line.

If you know how implement the GET_SECTOR_SIZE, i'm let me know it.

To make sure my SD is on correct format, i just free all its memory and use f_mkfs on it (Since i had FR_NO_FILESYSTEM error after some formatting).

I hope it would help some people trying their best on google research.

Best Regards.

Edit: I changed my card in the process.