cancel
Showing results for 
Search instead for 
Did you mean: 

WHY I cant use HAL_SPI_Transmit outside of the main function.

SKAŞ.1
Associate II

Hello Folks,

my initial goal is now to create a library. I have to use the SPI function outside of main.c file. However, I cannot make HAL_SPI_Transmit function run outside of main.c file. Also, I cannot able to run outside of main function inside the main.c

0693W00000D1WwQQAV.jpg It goes into HardFault_Handler

0693W00000D1WwpQAF.jpg 

I didn't do anything crazy, here is my full program too.

I should be able to use these functions outside the main function right?

Kind regards.

1 REPLY 1
TDK
Guru

You can use it, you just need to use it correctly.

Duplicate:

https://community.st.com/s/question/0D53W000010PAerSAG/spitransmit-get-stuck-at-hardfaulthandler-stm32f4xxitc

If you feel a post has answered your question, please click "Accept as Solution".