alexforencich / xboot

XBoot Extensible Bootloader
125 stars 69 forks source link

Disable interrupts for jump to bootloader when using EIND #12

Open hadleyrich opened 9 years ago

hadleyrich commented 9 years ago

I was having trouble with the API using an x128a4u and discovered that interrupts were affecting the jump into the bootloader.

alexforencich commented 9 years ago

Interesting. I'm not certain why this would be necessary, though. Do you know if EIND is getting clobbered by the ISR or if xboot changing EIND is causing a problem in the ISR? It should be possible to tell by looking at the assembly in the ISR to see if it is either modifying EIND and not restoring it or if it is using EIJMP or ECALL without properly initializing EIND. The jump into the ISR itself should not be a problem as JMP supplies the complete address. You can also try setting EIND to a nonsensical value in your code somewhere to see if that breaks the ISR.

hadleyrich commented 9 years ago

Hi!

Thanks very much for sharing xboot!

Hopefully I can be helpful, though I'm a little over my head so I'm not sure of the answers to your questions at this point, I'll try and figure it out.

I think it was jumping into the bootloader but failing to jump back again, at least that's what my debugging showed at one point.. I'll try and get some time to have another look at it when I've got my project out the door.

Cheers.

alexforencich commented 9 years ago

Could you possibly email be the assembly listing for your program? I can take a quick look at it to see if I can figure out what might be going on. For gcc, I think it is an lss file.

hadleyrich commented 9 years ago

I can but I'll try and produce a test case which shows it and give you some more info once I've met the deadline that is looming for me currently.

rknoll commented 9 years ago

hey, we just had the same issue and solved it exactly like you.. didn't investigate further though