cancel
Showing results for 
Search instead for 
Did you mean: 

Hal_Delay has stopped working ( STM32F030C6T6 )

XooM
Senior

Hal_Delay çalışmayı durdurdu ( STM32F030C6T6 )

Forumda buna benzer birçok konu okudum ama bir çözüm bulamadım. Sanırım sorunun kaynağının bu olduğunu anlayalı 7-8 gün oldu. Hal_Delay() çalışmadığı için GetTick() fonksiyonunu da kullanamıyorum. Basit testler yaparken Hal_delay() fonksiyonunun da çalışmadığını fark ettim. Bu sorunun üstesinden gelmeme yardım edebilir misin? Proje dosyası ektedir.

XooM_0-1731963507019.png

 

9 REPLIES 9

What's going on with BOOT0 pin ?

Dump Memory at 0x00000000 ? Same as 0x08000000 ?

Make sure FLASH is mapped at ZERO so the interrupts work.

HAL_Init() should be bringing up the SysTick

https://github.com/STMicroelectronics/cmsis-device-f0/blob/f3174b2801bbca0b4481d7d8ea62c9d153ce6789/Source/Templates/gcc/startup_stm32f042x6.s#L66

 /*SYSCFG clock enable*/

    LDR R0,=0x40021018
    LDR R1,=0x00000001
    STR R1, [R0]

/*Set CFGR1 register with flash memory remap at address 0*/
    LDR R0,=0x40010000
    LDR R1,=0x00000000
    STR R1, [R0]

  

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

https://www.st.com/resource/en/reference_manual/rm0360-stm32f030x4x6x8xc-and-stm32f070x6xb-advanced-armbased-32bit-mcus-stmicroelectronics.pdf#page=142

 

printf("SYSCFG CFGR %08X\n", *((uint32_t *)0x40010000) );

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I am a beginner in STM32. What exactly should I do? I don't know enough to understand what you are saying. But if you explain, maybe I can make the necessary corrections.

If it is like that, my project file is in the first message. Can you make corrections from there?

Start by confirming what's visible to the debugger at 0x08000000 and 0x00000000

Perhaps get STDIO putchar/puts/printf working? So you can output workable diagnosis.

Perhaps view SYSCFG->CFGR1 in the debugger's peripheral register view

The CM0 used in the STM32F0 can't remap the Vector Table via SCB->VTOR

Edit your startup_stm32f030.s

 

...
  .section .text.Reset_Handler
  .weak Reset_Handler
  .type Reset_Handler, %function
Reset_Handler:
  ldr   r0, =_estack
  mov   sp, r0          /* set stack pointer */

/* Call the clock system initialization function.*/
  bl  SystemInit

/* Check if boot space corresponds to test memory*/
 /*SYSCFG clock enable*/

    LDR R0,=0x40021018
    LDR R1,=0x00000001
    STR R1, [R0]

/*Set CFGR1 register with flash memory remap at address 0*/
    LDR R0,=0x40010000
    LDR R1,=0x00000000
    STR R1, [R0]

/* Copy the data segment initializers from flash to SRAM */
  ldr r0, =_sdata
  ldr r1, =_edata
  ldr r2, =_sidata
  movs r3, #0
  b LoopCopyDataInit

CopyDataInit:
  ldr r4, [r2, r3]
  str r4, [r0, r3]
  adds r3, r3, #4

LoopCopyDataInit:
  adds r4, r0, r3
  cmp r4, r1
  bcc CopyDataInit

/* Zero fill the bss segment. */
  ldr r2, =_sbss
  ldr r4, =_ebss
  movs r3, #0
  b LoopFillZerobss

FillZerobss:
  str  r3, [r2]
  adds r2, r2, #4

LoopFillZerobss:
  cmp r2, r4
  bcc FillZerobss

/* Call static constructors */
  bl __libc_init_array
/* Call the application's entry point.*/
  bl main

LoopForever:
    b LoopForever


.size Reset_Handler, .-Reset_Handler
...

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

or beginning of main()

  __HAL_RCC_SYSCFG_CLK_ENABLE();
  SYSCFG->CFGR1 &= ~3; // MEM_MODE=00b USER FLASH    
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Or you could put this stuff in your GitHub..

Assume you can edit files.

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

??

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

test10mod.rar should I use this file?
I couldn't understand it.
What should I do?
I'm still a beginner.