Hi, I tried the TIVA port and had problems with timer related code.
Specifically, every time I use chThreadSleep*() the system fails in chSchGoSleepTimeoutS(), when calling chDbgCheckClassS().
I am not sure where to start debugging this malfunctioning, so I ask you:
- Where can I look in order to debug this problem?
- May it be related to an incomplete/buggy implementation of timer related drivers?
Thank you in advance.
Timers & TIVA port
Moderator: Marco
Re: Timers & TIVA port
Hello mandrake,
What specific Tiva part are you using?
What are your system timer settings in chconf.h?
It is known the tickless mode for the system tick is not working right now, only a system tick using the systick timer. Maybe this is the problem?
ChibiStudio might be a usefull IDE to debug this problem, and of course other problems. The only problem with this is that it needs some custom setup as ChibiStudio is not yet shipped with ChibiOS 3.
Marco
What specific Tiva part are you using?
What are your system timer settings in chconf.h?
It is known the tickless mode for the system tick is not working right now, only a system tick using the systick timer. Maybe this is the problem?
ChibiStudio might be a usefull IDE to debug this problem, and of course other problems. The only problem with this is that it needs some custom setup as ChibiStudio is not yet shipped with ChibiOS 3.
Marco
Re: Timers & TIVA port
I'm using the TM4C1294 part, with a demo copied from the one I guess you wrote.
I didn't touch the chconf.h, nevertheless here is the code:
- chconf.h: http://pastebin.com/MKUAJSyG
- main.c: http://pastebin.com/Aj0zvgxF
Just to be clear, I don't know very much about ChibiOS since I started using it a few days ago, so I'm sorry if I bother you with stupid questions.
I didn't touch the chconf.h, nevertheless here is the code:
- chconf.h: http://pastebin.com/MKUAJSyG
- main.c: http://pastebin.com/Aj0zvgxF
Just to be clear, I don't know very much about ChibiOS since I started using it a few days ago, so I'm sorry if I bother you with stupid questions.
- Giovanni
- Site Admin
- Posts: 14563
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1111 times
- Been thanked: 937 times
- Contact:
Re: Timers & TIVA port
Hi,
The failure could be a stack overflow, do you have debug options enabled in chconf.h? in case of failure the system halts and the parameter of the halt functions points to an error string that can be inspected using a debugger.
Giovanni
The failure could be a stack overflow, do you have debug options enabled in chconf.h? in case of failure the system halts and the parameter of the halt functions points to an error string that can be inspected using a debugger.
Giovanni
Re: Timers & TIVA port
Well, I tried a less ortodox solution turning on a led immediately before the chDbgPanic(), in chDbgCheckClassS() as I said.
The led turns on so I guess it actually fails.
I don't have idea how to use the debugging features, if I need extra hardware I don't have it, so I had to use this other solution.
The led turns on so I guess it actually fails.
I don't have idea how to use the debugging features, if I need extra hardware I don't have it, so I had to use this other solution.
Re: Timers & TIVA port
As far I can see there should be no problem in the files. Is the provided demo working correct?
No problem mandrake, there are no stupid questions
For the debugging features you don't need extra hardware, assuming you are using the Connected Launchpad board. You can debug the board using gdb and openocd 0.9 beta.
I will write a small guide to setup ChibiStudio for Tiva development this afternoon when i'm home.
Marco
No problem mandrake, there are no stupid questions

For the debugging features you don't need extra hardware, assuming you are using the Connected Launchpad board. You can debug the board using gdb and openocd 0.9 beta.
I will write a small guide to setup ChibiStudio for Tiva development this afternoon when i'm home.
Marco
- Giovanni
- Site Admin
- Posts: 14563
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1111 times
- Been thanked: 937 times
- Contact:
Re: Timers & TIVA port
The fact that chDbgCheckClassS() detects an error is VERY strange, the problem apparently is not in your code.
What toolchain are you using?
Giovanni
What toolchain are you using?
Giovanni
Re: Timers & TIVA port
What do you mean by toolchain?
I ported Marco's code on ChibiOS 2.6, but even trying the original code (written on top of ChibiOS 3) the sleep syscalls fail.
To be completely honest I just helped a friend of mine, who is the one actually owning the TIVA hardware.
I compile using directly the Makefile, I don't know if there are other options, I'm a bit confused by your question.
Anyhow, the situation is:
- Tiva code from ChibiOS-Contrib (based on ChibiOS 3) + the demo linked in my previous post -> failure on chThdSleepMilliseconds(), specifically in chDbgCheckClassS().
- Tiva code ported on ChibiOS 2.6 + the same demo -> same problem.
I hope this info can help.
I ported Marco's code on ChibiOS 2.6, but even trying the original code (written on top of ChibiOS 3) the sleep syscalls fail.
To be completely honest I just helped a friend of mine, who is the one actually owning the TIVA hardware.
I compile using directly the Makefile, I don't know if there are other options, I'm a bit confused by your question.
Anyhow, the situation is:
- Tiva code from ChibiOS-Contrib (based on ChibiOS 3) + the demo linked in my previous post -> failure on chThdSleepMilliseconds(), specifically in chDbgCheckClassS().
- Tiva code ported on ChibiOS 2.6 + the same demo -> same problem.
I hope this info can help.
Re: Timers & TIVA port
Giovanni probably means what version of for example gcc you are using.
The Tiva port is designed to work with ChibiOS 3 and is not tested with earlier versions. This is probably one of the reasons why it's not working.
I looked at your files again and it seems the chconf.h file is not the same file as the chconf.h file from the contrib repository, i think you have a file from ChibiOS 2.6 or so. Can you try to compile your program again with a correct chconf.h file?
The Tiva port is designed to work with ChibiOS 3 and is not tested with earlier versions. This is probably one of the reasons why it's not working.
I looked at your files again and it seems the chconf.h file is not the same file as the chconf.h file from the contrib repository, i think you have a file from ChibiOS 2.6 or so. Can you try to compile your program again with a correct chconf.h file?
Re: Timers & TIVA port
Of course, it is your code "translated" in order to work on ChibiOS 2.6, but since neither the one from ChibiOS-Contrib "vanilla" is working I think that's not the problem.
Who is online
Users browsing this forum: No registered users and 1 guest