cancel
Showing results for 
Search instead for 
Did you mean: 

littleFS on STM32H753 using Keil - issue

AShel.1
Associate III

Hello,

I'm using STM32H753 eval board, earlier I was using STM32CubeIDE wherein I've successfully tested littleFS(File system) library with external flash. 

littleFS - https://github.com/littlefs-project/littlefs

this code works ok in debug mode and normal mode(without debugger) if I compile it through STM32CubeIDE.

then I've switched to Keil MDK - version 5.33, ported all the application function, in debug mode this code working ok, I'm able to format external flash with littleFS, mount it and create/ read/ write files. 

if I download code in normal mode(without debugger) then the board is not coming up it means execution is not reaching even to GPIO initialization as I've just put one LED ON in GPIO initialization. 

earlier I thought it might be watchdog reset issue but same code without initializing littleFS works ok in normal mode.

then, I tried increasing stack and heap size to max extent but it did not helped.

this littleFS library is based on nested function calls and structures are passed as input parameters to each function.

I've checked in compiler user guide, if any limitations are given on passing structures, those are general limitations only.

my code is:

int main(void)

{

/* USER CODE BEGIN 1 */

uint8_t res;

/* USER CODE END 1 */

/* MCU Configuration--------------------------------------------------------*/

/* Reset of all peripherals, Initializes the Flash interface and the Systick. */

HAL_Init();

/* USER CODE BEGIN Init */

/* USER CODE END Init */

/* Configure the system clock */

SystemClock_Config();

/* USER CODE BEGIN SysInit */

/* USER CODE END SysInit */

/* Initialize all configured peripherals */

MX_GPIO_Init();

MX_MDMA_Init();

MX_QUADSPI_Init();

/* USER CODE BEGIN 2 */

// resetSlave();

//GPIOF->ODR ^= LED1_RGB_Pin;

//HAL_Delay(10);

res = extFlashInit();/* TODO: handle exception */

if(res == 0)

{

GPIOF->ODR ^= LED1_RGB_Pin;

lfsInit();/* TODO: handle exception */

}

/* USER CODE END 2 */

/* Infinite loop */

/* USER CODE BEGIN WHILE */

while (1)

{

}

}

did anybody used littleFS with Keil?

thanks,

3 REPLIES 3
Andrew Neil
Evangelist III

It's important to let people know when you are posting the same thing in multiple places - called "cross-posting" - otherwise you waste peoples time giving an answer that has already been given in the other place(s):

https://community.arm.com/developer/tools-software/tools/f/keil-forum/48893/littlefs-library-with-stm32h7-memory-issue

On this forum, use this button to properly post source code:

0693W000008wfhEQAQ.png 

>>did anybody used littleFS with Keil?

No

But it sounds more like you actually need to do some basic debugging, and get HardFault_Handler() and Error_Handler() setup so you can run the issues to ground.

Posted several examples here of fault handlers here that can output in Keil via printf() using plumbing to use USART or SWV (Serial Debug)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
HYass.1
Associate

Please can you send me your own project folder because the one in the github did not work for me.