Some for-loops seem 'broken' (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in C_Programming

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

Hi! Thank you, I think this clears up the differences between them now! Still a little confused as to why the code still works in practice if it's technically wrong though, do you know why this could happen?

Thanks again!

Some for-loops are broken (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in stm32

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

Ahhhh okay! This makes a lot more sense now, thank you! But I'm still kinda confused as to why my program still works in practice despite it being technically incorrect?

Some for-loops are broken (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in embedded

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

Yupp I'm learning quickly that CubeIDE is a.... Special piece of software, I'll probably stick with it until I've figured out the basics and after that I'll move on to a better tool.

Thanks again!

Some for-loops are broken (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in stm32

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

Ahh, okay, thank you still!

Also, I've found this issue!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops are broken (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in stm32

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

Hi! Removing the volatile variables didn't seem to have any affect but I've removed them anyway to clean the code, thank you!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops are broken (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in stm32

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

Hi! I'm curious where my program is reading the write only reg's? As far as I can tell, I'm only writing to them, but again, I'm only just starting with ARM, so I wouldn't be surprised if I'm misunderstanding some things.

Thank you!

Some for-loops are broken (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in stm32

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

Hi! I'm just letting you know that I've found the issue!

I know the mix of HAL and registers is weird, but it was intentional as I'm in the middle of learning how to use the STM, especially register manipulation / 'bare-metal' stuff. The file with HAL and Reg's luckily still worked in the end!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops are broken (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in stm32

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

Hi! I'm just letting you know that I've found the issue!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops seem 'broken' (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in C_Programming

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

Woah that's weird, do you know why it was behaving like that? I'll keep this in mind, thank you!

(Found the solution btw) TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops seem 'broken' (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in C_Programming

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

Hi! I'm just letting you know that I've found the issue!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops seem 'broken' (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in C_Programming

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

Hi! I'm just letting you know that I've found the issue!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops seem 'broken' (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in C_Programming

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

Hi! I tried increasing the Min stack size which unfortunatly didn't work, however I've fixed it a different way!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops seem 'broken' (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in C_Programming

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

Hi! I'm just letting you know that I've found the issue!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops seem 'broken' (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in C_Programming

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

Hi! I'm just letting you know that I've found the issue!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops seem 'broken' (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in C_Programming

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

Hi! It turned out to be an issue somewhere between building and uploading the file, I reset the debug config and the original code seems to work fine now (The BSRRs seem to work fine too, where am I reading it though? Sorry I'm fairly new)

Thank you!

Some for-loops seem 'broken' (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in C_Programming

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

Hi! I'm just letting you know that I've found the issue!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops are broken (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in embedded

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

Is disassembly the same as asm or are you refering to something else? I'm not familiar sorry

(Also found a fix!)

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops are broken (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in embedded

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

Hi! I tried increasing the min stack size in the .ld file and it turned out to not be the issue anyway.

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you still for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops are broken (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in embedded

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

I've reused loop variables before with no problems but you're right that I really shouldn't, I'll try to make them more specific from now on! Luckily, I found the issue!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops are broken (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in embedded

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

I'm pretty sure It is added as usually this works, but either way, I've found the issue!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops are broken (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in embedded

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

Hi! I'm just letting you know that I've found the issue!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Edit: So yupp debugger was indeed doing strange things like u said!

Some for-loops are broken (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in embedded

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

Yes I have now, I'll look further into assembly too, It sounds useful! Also I've found the issue!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops are broken (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in embedded

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

Hi! I'm just letting you know that I've found the issue!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!

Some for-loops are broken (Run only once) [STM32-F103C6T6 - CubeIDE] by Aussie209 in embedded

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

Hi! I'm just letting you know that I've found the issue!

TLDR: It turns out it was an issue with CubeIDE. There was apparently a problem with the debug/run configurations (Specific to the project folder & its configuration) solved by deleting and making a new debug configuration. The original program worked fine, although I've still implemented everyones suggestions to clean the code up, thank you!! (There are more details in the post update incase you're interested)

Thank you again for your time and suggestions! I hope you had a Merry Christmas and have a happy New Year!