cancel
Showing results for 
Search instead for 
Did you mean: 

sdcard interfacing with stm32f411ceu6

Shubham-8080
Visitor

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 */

}
1 REPLY 1
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.