Chibi Only Running while in debug mode

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
goahunter
Posts: 29
Joined: Thu Aug 16, 2012 10:59 pm

Chibi Only Running while in debug mode

Post 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!
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Chibi Only Running while in debug mode

Post 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
talsit
Posts: 24
Joined: Wed Oct 10, 2012 10:09 am

Re: Chibi Only Running while in debug mode

Post 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...
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Chibi Only Running while in debug mode

Post 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
goahunter
Posts: 29
Joined: Thu Aug 16, 2012 10:59 pm

Re: Chibi Only Running while in debug mode

Post 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.
goahunter
Posts: 29
Joined: Thu Aug 16, 2012 10:59 pm

Re: Chibi Only Running while in debug mode

Post by goahunter »

I made a short video showing the problem to better help diagnosis.
http://www.youtube.com/watch?v=XvSZoPINOu8
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Chibi Only Running while in debug mode

Post 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
goahunter
Posts: 29
Joined: Thu Aug 16, 2012 10:59 pm

Re: Chibi Only Running while in debug mode

Post 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?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Chibi Only Running while in debug mode

Post by Giovanni »

It is jumping in RAM... are the BOOT pins configured to start from flash?

Giovanni
goahunter
Posts: 29
Joined: Thu Aug 16, 2012 10:59 pm

Re: Chibi Only Running while in debug mode

Post by goahunter »

Problem solved.. seriously a facepalm moment. Thanks for putting up with me GIovanni! lol
Post Reply