Re: IAR AVR Port
Posted: Sun Apr 28, 2013 6:25 am
Fair enough.
Can you tell me what the port_switch() routine is doing? It seems to use r22/r23 and r24/r25 for something related to the stack pointer. It also doesn't save and restore all the registers, which I understand is how you speed up context switches, because the compiler saves and restores some of them. But I don't know which ones.
I'm still trying to understand what's going wrong.
I'm doing this on a Mac without a debugger. I have Windows in a VM and can debug using AVR Studio 6 (which has GCC, too), but it seemed like it would be pretty hard to get ChibiOS to build in that environment; I'd have to make a project and add all the files and I'm not sure how much work it would take to learn AVR Studio 6 and get it to build correctly. I was hoping I could figure it out with printf(), but it's hard to trace through the execution without being able to single step.
Can you tell me what the port_switch() routine is doing? It seems to use r22/r23 and r24/r25 for something related to the stack pointer. It also doesn't save and restore all the registers, which I understand is how you speed up context switches, because the compiler saves and restores some of them. But I don't know which ones.
I'm still trying to understand what's going wrong.
I'm doing this on a Mac without a debugger. I have Windows in a VM and can debug using AVR Studio 6 (which has GCC, too), but it seemed like it would be pretty hard to get ChibiOS to build in that environment; I'd have to make a project and add all the files and I'm not sure how much work it would take to learn AVR Studio 6 and get it to build correctly. I was hoping I could figure it out with printf(), but it's hard to trace through the execution without being able to single step.