Page 1 of 1

Chibi Only Running while in debug mode

Posted: Thu Oct 11, 2012 8:32 pm
by goahunter
So I'm really not sure of how to ask this question, but I'm having an issue with Chibi and my Micro (STM32F103VG) in Keil. I start by compiling my firmware which compiles fine. I proceed to flash my firmware to the chip, which executes fine. I then proceed to test it out, but low and behold I get nothing back. I then proceed to reflash the chip and go directly into debug mode where I can step through the code and it works fine. I find this odd, but not as odd as this: When I stop, reset and rerun my code, I get nothing. No matter where I set a breakpoint I never hit it. I've gone as far back as cstartup.s and still get no breaks. Any Ideas would be greatly appreciated!

Re: Chibi Only Running while in debug mode

Posted: Thu Oct 11, 2012 8:48 pm
by Giovanni
Not being able to break into the startup makes me think of a debugger problem. Does the standard demo work for you?

Giovanni

Re: Chibi Only Running while in debug mode

Posted: Fri Oct 12, 2012 4:17 pm
by talsit
This happened to me when I was copying projects around. Project A would run fine, but Project B (which was literally copied from one directory to another, and renamed), would not step past main(). I found out that the problem was with improper debugger settings, something in the Download section of the Debugger, under Use flash loader. I'm using IAR. But check to see if your release and debug configs are the same with that respect...

Re: Chibi Only Running while in debug mode

Posted: Fri Oct 12, 2012 5:00 pm
by Giovanni
If I remember well the flash loader settings are not kept in the project files, you have to do them manually in each new project.

Giovanni

Re: Chibi Only Running while in debug mode

Posted: Fri Oct 12, 2012 5:21 pm
by goahunter
I kinda had a feeling that this was the case. That is exactly what happened. I moved the directory to a github folder so that I can keep it under version control and now I'm getting this. Also Giovanni, I tried a fresh demo of chibi and still no response although now It wont even run once in debug.

Re: Chibi Only Running while in debug mode

Posted: Fri Oct 12, 2012 5:58 pm
by goahunter
I made a short video showing the problem to better help diagnosis.
http://www.youtube.com/watch?v=XvSZoPINOu8

Re: Chibi Only Running while in debug mode

Posted: Sun Oct 14, 2012 8:50 am
by Giovanni
I noticed you are compiling without optimizations "-O0", are you using 2.4.2? I just fixed a related bug on that version.

Giovanni

Re: Chibi Only Running while in debug mode

Posted: Mon Oct 15, 2012 9:13 pm
by goahunter
Giovanni,

I am using 2.4.2, but im not sure if this is the problem. I tried changing the optimization level to -03 to see if it would run but still no success. I've reinstalled Keil to the latest version, reverted to known good code, compiled and run a fresh Chibi demo for the STM32F32F103 changed the physical chip and PCB with no luck. It does seem to be something with the Flash/Debug. I've even done it with both my laptop and desktop. I notice that when it starts out the program goes to 0x200001E0 but never goes to the next address and when it runs it sends the pointer to 0x8xxxxxxx Is it possible that the reset is pointing it to the improper location being the reason why the OS won't start?

Re: Chibi Only Running while in debug mode

Posted: Mon Oct 15, 2012 9:19 pm
by Giovanni
It is jumping in RAM... are the BOOT pins configured to start from flash?

Giovanni

Re: Chibi Only Running while in debug mode

Posted: Mon Oct 15, 2012 9:56 pm
by goahunter
Problem solved.. seriously a facepalm moment. Thanks for putting up with me GIovanni! lol