2024-03-28 02:42 AM
I am using a stm32F103ZET6 to just blinking a led but the HAL_Delay() is not working.
I change the HAL_Delay() with for loop and it work.
this is the code that i am using :
while (1)
{
HAL_GPIO_WritePin(Led_301_GPIO_Port, Led_301_Pin, 1);
HAL_Delay(500);
//for (int i=0; i < 500000; i++);
HAL_GPIO_WritePin(Led_301_GPIO_Port, Led_301_Pin, 0);
//for (int i=0; i < 500000; i++);
}
}
I want to work with HAL_Delay because i need to use it in a project with this mcu
2024-03-28 06:03 AM - edited 2024-03-28 06:08 AM
I programmed the board using a CAN connection. I converted the compiled code into an SREC file and then transmitted it to the board via the CAN bus using a PCAN and microboot on my laptop.
Since my code upload method has been successfully tested, I'm confident
because when i add a for loop to the code that will enable the LED to blink. but without HAL_Delay
2024-03-28 06:39 AM
Not sure what do you do with these steps, but from software point of view I don't see an issue.
2024-03-28 08:55 AM - edited 2024-03-28 09:19 AM
2024-03-28 10:25 AM
Seems you're executing the code from the SRAM (you didn't mentioned that important information) but it overlaps with r/w data and with VTOR. That's why the Systick interrupt (used by HAL_Delay) is not working
You need to rethink/rework your project.
2024-03-28 04:32 PM
Can you please explain this. What do you mean by rethink/rework
2024-03-28 04:38 PM - edited 2024-03-29 12:17 AM
Also i have to add some information.
I change the flash memory in the file .std from 512ko to 484ko and the start address from 0x8000000 to 0x8006000. Because in the project specification i have to do that.