Skip to main content
Associate
Question

sdcard interfacing with stm32f411ceu6

Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code.

i am trying to interface stm32f411ceu6 with sdcard  using spi ,and i have successfully interfaced it but when i try to run this code using freertos by using another timer as timebase source it not works 

below code is in interrupt .c file . i wanted to use freertos just to make task but i dont know why my code not works when i enable freertos from stmcubemx

 
void SysTick_Handler(void)
{
 /* USER CODE BEGIN SysTick_IRQn 0 */
 if(Timer1 > 0)
 Timer1--;
 if(Timer2 > 0)
 Timer2--;
 /* USER CODE END SysTick_IRQn 0 */

 HAL_IncTick();

 /* USER CODE BEGIN SysTick_IRQn 1 */
 /* USER CODE END SysTick_IRQn 1 */

}
This topic has been closed for replies.

2 replies

Andrew Neil
Super User

Welcome to the forum.

Please see How to write your question to maximize your chances to find a solution for best results.

In particular, please give details of your hardware, your tools, etc.

 


@Shubham-8080 wrote:

below code is in interrupt .c file . i wanted to use freertos just to make task but i dont know why my code not works when i enable freertos from stmcubemx

 
void SysTick_Handler(void)
{
 /* USER CODE BEGIN SysTick_IRQn 0 */
 if(Timer1 > 0)
 Timer1--;
 if(Timer2 > 0)
 Timer2--;
 /* USER CODE END SysTick_IRQn 0 */

 HAL_IncTick();

 /* USER CODE BEGIN SysTick_IRQn 1 */
 /* USER CODE END SysTick_IRQn 1 */

}

So what, exactly, does "not working" mean?

  • What were you expecting it to do ?
  • What is it actually doing ?
  • What debugging have you done to find why it's "not working" ?

How To Debug.

 

You haven't shown your definitions of the two timer variables. They are being updated in an interrupt handler, so are they volatile ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate

no they are not volatile.

  • What were you expecting it to do ?
    i trying to develop code in which sdcard driver code must be thread safe when i integrate it with freertos program.
  • What is it actually doing ?
    the driver i am currently using it is not working when i try to use it with freertos code it shows only the sdcard mount successfully and it is not able to create the file and add some content in it .
  • What debugging have you done to find why it's "not working" ?
    currently i am debugging using debug message on uart.