I'm using CubeMx and STM32F0 and F1 , HAL_GPIO_WritePİn(...); working reverse ,when I write HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_RESET); led is on.Also when I use SPI for STM32F0 I'm gettin Hard_Fault function .Where is the problem
Hello Emrah Duatepe,
is your LED connected from VCC->anode->cathode->GPIO_PIN? In this case, logical low level will turn on LED.
Regarding SPI, we would need more code to see how you use API function.
Well the processor will tell you exactly where if faulted, did you look there?
Most likely somewhere in your code you are casting an unaligned pointer and doing a 16/32-bit access
ie x = *((uint16_t *)ptr);
Perhaps in the SPI library if you are using 16-bit mode, and hand in unaligned buffer.
Hello Tilen and Clive ,First I thank you to help.My problem was solved earlier in another subject.It is the problem to hard fault is related unaligned pointer.It is OK now.Reversing problem is related with my module ,I haven't realised it for a while ,It is not a problem I mean different connection like you say.By the way I use your codes Tilen with some alterations.Thanks again .Have a good day!
Retrieving data ...