Hi
I am currently using SPI driver from CMSIS drivers, SPI_STM32F103xx.c for my project.(STM32F103RB discovery board) I configured RTE_driver.h, defined RTE_SPI1 as 1, since I require SPI1 access structure to be used in my project. After compilation of the following piece of code I get no errors, but unfortunately, in debugger mode when i do step_in in this line Drv_spi1->GetVersion(), it goes to hardfault_handler, instead for GetVersion function body.
void init_middleware (ARM_DRIVER_SPI *Drv_spi1) { ARM_DRIVER_VERSION version; ARM_SPI_CAPABILITIES drv_capabilities; Drv_spi1->GetVersion(); } int main(void) { -- ARM_DRIVER_SPI Driver_SPI0; init_middleware(&Driver_SPI0); -- }
please help me if i am wrong. I want to use CMSIS SPI driver without CMSIS RTOS. Please provide me an example code of using CMSIS SPI driver(SPI1 access structure) without using CMSIS RTOS. Thanks Gokul.
You need to reference the driver structure as extern and outside main.
Also you should reference SPI1 instance which you have enabled (not SPI0).
Try the following:
extern ARM_DRIVER_SPI Driver_SPI1; int main(void) { init_middleware(&Driver_SPI1); }
Dear Robert, Thanks for your prompt help. Now My SPI communication through cmsis is working well. sorry for late reply. Thanks again. Gokul.