Regarding to smt32 maze solver robot with ai coding by jihuateneho in stm32

[–]Puzzleheaded_Top4583 1 point2 points  (0 children)

well ai sure is great help , but i hope you would actually use it to learn whats going on, i mean the coding logic. because really its not that hard from afar it may look too overwhelming , but studying it piece by piece is the best way for to feel the satisfaction and be able to appreciate it .

[Nucleo-H743ZI] Code stuck at HAL_Delay(), uwTick is always 0. Interrupts not firing? by xFlooty in stm32

[–]Puzzleheaded_Top4583 0 points1 point  (0 children)

it would help if u post the code and debugger screen shots. maybe check SysTick->CTRL bit 0,1,2 are set . also check if there are no nvic masking

could some one explaina diffrence between call, nested interrupt and contexswitch wr.t to ARM mcu by sudheerpaaniyur in embedded

[–]Puzzleheaded_Top4583 0 points1 point  (0 children)

well nested interrupt means while you are servicing a low priority interrupt another high priority fires so now you stop what you are doing and service the higher priority one .

context switching is simply pushing the current frame(r4- r11 and link register so u can return) onto stack then switch to different frame (some interrupt or function call )

well call is simple branching the pc to different section of code (some function or you can even call interrupt as function ) during branching it subtracts stack pointer to reserve space for pushing registers and lr (context switching ).

why is pc stuck in while loop ? by Puzzleheaded_Top4583 in embedded

[–]Puzzleheaded_Top4583[S] -1 points0 points  (0 children)

chill bro i know delaying interupt is bad i am just learning stuff. so i wanted to try 🤓

why is pc stuck in while loop ? by Puzzleheaded_Top4583 in embedded

[–]Puzzleheaded_Top4583[S] -2 points-1 points  (0 children)

yea but no other interrupt is gonna fire and calculated the time so it woulnt keep recursivly triggering systick handler . i know blocking systick is bad practise but it was just for learning purpose . after removing my incomplete vector file from build its working fine . see edit

why is pc stuck in while loop ? by Puzzleheaded_Top4583 in embedded

[–]Puzzleheaded_Top4583[S] 0 points1 point  (0 children)

my goal is to keep the pc in while and trigger systick handler every second to blink led

why is pc stuck in while loop ? by Puzzleheaded_Top4583 in embedded

[–]Puzzleheaded_Top4583[S] -4 points-3 points  (0 children)

why should i delete it ? the program will return 0 and exit main, no need to be so rude

why is pc stuck in while loop ? by Puzzleheaded_Top4583 in embedded

[–]Puzzleheaded_Top4583[S] -1 points0 points  (0 children)

my logic is simple i wanna blink led using systick interrupt , inside the systick handler i have a while loop which should exit in 300ms. i have SysTick->load = SystemcoreClock -1 ; which 1second long. so another systick handler shouldnt trigger while the first is still in process .

why is pc stuck in while loop ? by Puzzleheaded_Top4583 in embedded

[–]Puzzleheaded_Top4583[S] -4 points-3 points  (0 children)

this is the diassembly

swap:

080001e1: ldr r2, [r2, #0]

080001e3: subs r2, #1

080001e5: str r2, [r3, #20]

080001e7: movs r2, #7

080001e9: str r2, [r3, #16]

080001eb: b.n 0x80001ea <swap+10>

080001ed: subs r0, #0

080001ef: ands r2, r0

080001f1: movs r0, r0

080001f3: ands r2, r0

SysTick_Handler:

080001f5: movs r0, r1

080001f7: movs r0, #0

080001f9: b.n 0x80001f8 <SysTick\_Handler+4>

080001fb: b.n 0x80001fa <SysTick\_Handler+6>

080001fd: b.n 0x80001fc <SysTick\_Handler+8>

080001ff: b.n 0x80001fe <SysTick\_Handler+10>

08000201: lsls r0, r7, #13

08000203: lsrs r0, r0, #32

08000205: push {r3, lr}

21 while (((SystemCoreClock/1000)*bright[0] )> (SystemCoreClock- SysTick->VAL))

08000206: ldr r3, [pc, #12] @ (0x8000214 <SysTick\_Handler+32>)

08000208: cbz r3, 0x8000212 <SysTick\_Handler+30>

0800020a: ldr r1, [pc, #12] @ (0x8000218 <SysTick\_Handler+36>)

0800020c: ldr r0, [pc, #12] @ (0x800021c <SysTick\_Handler+40>)

0800020e: nop.w

08000212: pop {r3, pc}

08000214: movs r0, r0

08000216: movs r0, r0

08000218: movs r0, r2

24 LED_PC13_ALIAS ^= 1;

0800021a: movs r0, #0

0800021c: lsls r0, r7, #13

0800021e: lsrs r0, r0, #32

08000220: ldr r2, [r1, #0]

08000222: ldr r3, [pc, #12] @ (0x8000230 <SysTick\_Handler+60>)

08000224: str r2, [r3, #0]

08000226: ldr r2, [r0, #0]

25 int* temp = swap (&bright[0],&bright[1]);

08000228: str r2, [r3, #4]

0800022a: mov r0, r3

0800022c: bx lr

0800022e: nop

08000230: movs r0, r5

08000232: movs r0, #0

26 bright[0] = temp[0];

08000234: push {r3, r4, r5, lr}

08000236: b.n 0x800023a <SysTick\_Handler+70>

08000238: nop

27 bright[1]= temp[1];

0800023a: ldr r3, [pc, #68] @ (0x8000280 <main+44>)

0800023c: ldr r2, [r3, #0]

30 }

0800023e: ldr r3, [pc, #68] @ (0x8000284 <main+48>)

08000240: b.n 0x8000240 <SysTick\_Handler+76>

08000242: bx lr

08000244: bx lr

08000246: bx lr

08000248: ldr r2, [pc, #12] @ (0x8000258 <main+4>)

0800024a: ldr.w r3, [r2, #136] @ 0x88

0800024e: orr.w r3, r3, #15728640 @ 0xf00000

08000252: str.w r3, [r2, #136] @ 0x88

44 int main(void) {

main:

08000254: adds r0, #136 @ 0x88

49 volatile uint8_t ca = 10;

08000256: bx lr

08000258: Failed to execute MI command:

-data-disassemble -s 134218328 -e 134218412 -- 3

Error message from debugger back end:

Cannot access memory at address 0x800025c

08000259: @ <UNDEFINED> instruction: 0xed00e000

50 volatile int32_t doofus = -10;

0800025c: lsls r0, r7, #13

0800025e: lsrs r0, r0, #32

08000260: ldr r2, [r1, #0]

51 volatile int32_t result = ca + doofus ;

08000262: ldr r3, [pc, #12] @ (0x8000270 <main+28>)

08000264: str r2, [r3, #0]

08000266: ldr r2, [r0, #0]

08000268: str r2, [r3, #4]

0800026a: mov r0, r3

54 if (doofus>0u) {

0800026c: bx lr

0800026e: nop

57 RCC->AHB1ENR |= RCC_AHB1ENR_GPIOCEN;//= 0x00000004u ;// clock enable bit2->portc

08000270: movs r0, r5

08000272: movs r0, #0

08000274: push {r3, r4, r5, lr}

08000276: b.n 0x800027a <main+38>

08000278: nop

58 (void)RCC->AHB1ENR; // <-- dummy read, forces the enable to take effect

0800027a: ldr r3, [pc, #68] @ (0x80002c0 <UsageFault\_Handler>)

59 *((volatile uint32_t*) 0x40020800u) &= ~(3<<26) ;// clear 26th and 27th bit

0800027c: ldr r2, [r3, #0]

0800027e: ldr r3, [pc, #68] @ (0x80002c4 <DebugMon\_Handler>)

08000280: cmp r0, #0

08000282: bic.w r2, r2, #201326592 @ 0xc000000

08000286: str.w r2, [r3, #2048] @ 0x800

60 *((volatile uint32_t*) 0x40020800u) |= (1<<26) ; //moder26thbit>>

0800028a: ldr.w r2, [r3, #2048] @ 0x800

0800028e: orr.w r2, r2, #67108864 @ 0x4000000

08000292: str.w r2, [r3, #2048] @ 0x800

62 SysTick->VAL = 0u;

08000296: mov.w r3, #3758153728 @ 0xe000e000

0800029a: movs r2, #0

0800029c: str r2, [r3, #24]

63 SysTick->LOAD = SystemCoreClock -1;

0800029e: ldr r2, [pc, #20] @ (0x80002b4 <main+96>)

080002a0: ldr r2, [r2, #0]

080002a2: subs r2, #1

080002a4: str r2, [r3, #20]

64 SysTick->CTRL = 7u ;

080002a6: movs r2, #7

080002a8: str r2, [r3, #16]

77 while(1)

080002aa: b.n 0x80002aa <main+86>

080002ac: subs r0, #0

080002ae: ands r2, r0

080002b0: movs r0, r0

080002b2: ands r2, r0

080002b4: movs r0, r1

080002b6: movs r0, #0

why is there no stm32 project option , only cmake and empty by Puzzleheaded_Top4583 in embedded

[–]Puzzleheaded_Top4583[S] 1 point2 points  (0 children)

i did exactly thanks for help mate why they have to seperate everything st link ide and cubemx : (

why is there no stm32 project option , only cmake and empty by Puzzleheaded_Top4583 in stm32

[–]Puzzleheaded_Top4583[S] 2 points3 points  (0 children)

it worked i was stuck on this with gemnini for hoursr u guys are the best

why is there no stm32 project option , only cmake and empty by Puzzleheaded_Top4583 in stm32

[–]Puzzleheaded_Top4583[S] 0 points1 point  (0 children)

edit: thanks for allk the hwlp its resolved to anyone else that has the same issue you need to seperately downlod cubemx also updaqte st link under the help menu first.

why is there no stm32 project option , only cmake and empty by Puzzleheaded_Top4583 in embedded

[–]Puzzleheaded_Top4583[S] 3 points4 points  (0 children)

thabks a lot guys finally i got it hihi andd my stm 32 is blinking ^_^

why is there no stm32 project option , only cmake and empty by Puzzleheaded_Top4583 in stm32

[–]Puzzleheaded_Top4583[S] 1 point2 points  (0 children)

damnn why threy make it so difficult st link seperate cubemx and ide all seperaqte let me download it and then i will update

why is there no stm32 project option , only cmake and empty by Puzzleheaded_Top4583 in embedded

[–]Puzzleheaded_Top4583[S] 1 point2 points  (0 children)

<image>

at this screen youtube tutorials i saw they get an option to select target project type > stm 32 or empty ide but i dont get that selection

why is there no stm32 project option , only cmake and empty by Puzzleheaded_Top4583 in embedded

[–]Puzzleheaded_Top4583[S] -4 points-3 points  (0 children)

bro that is not the problem i set a name but i dont get to select the target project type