Hi,
I am new to ChibiOS and started to play with the demos. The new 21.6.0 version somehow broke the demos/AVR/NIL-ARDUINO-UNO and demos/AVR/RT-ARDUINO-UNO demos (I tried only these two). FYI. they work perfectly with 20.3.3. I compiled them with the AVR GCC from the Arduino installation directory and also with a custom own compiled AVR-GCC. Finally I flashed them with avrdude over the serial/usb cable the same way as Arduino IDE does. The version 20.3.3 works perfectly, however the 21.6.0 doesn't.
Best regards,
Szilveszter Zsigmond
broken AVR demos Topic is solved
-
- Posts: 12
- Joined: Mon Jun 14, 2021 5:42 pm
- Has thanked: 9 times
- Been thanked: 5 times
- Contact:
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: broken AVR demos Topic is solved
Hi,
Thanks for finding, The AVR port is not yet tested on 21.6.0 (which is a release candidate), I will look at changes between versions.
Giovanni
Thanks for finding, The AVR port is not yet tested on 21.6.0 (which is a release candidate), I will look at changes between versions.
Giovanni
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: broken AVR demos
Hi again,
I don't know if this is the only problem but in chcore.c you should put this code:
to replace the existing _port_switch() function. The problem was that "_CHIBIOS_RT_" changed in "__CHIBIOS_RT__" in latest release. This fix will be included in 21.6.1, committed on repository.
Giovanni
I don't know if this is the only problem but in chcore.c you should put this code:
Code: Select all
void _port_switch(thread_t *ntp, thread_t *otp) {
(void)ntp;
(void)otp;
asm volatile ("push r2");
asm volatile ("push r3");
asm volatile ("push r4");
asm volatile ("push r5");
asm volatile ("push r6");
asm volatile ("push r7");
asm volatile ("push r8");
asm volatile ("push r9");
asm volatile ("push r10");
asm volatile ("push r11");
asm volatile ("push r12");
asm volatile ("push r13");
asm volatile ("push r14");
asm volatile ("push r15");
asm volatile ("push r16");
asm volatile ("push r17");
asm volatile ("push r28");
asm volatile ("push r29");
#if defined(__CHIBIOS_RT__)
asm volatile ("movw r30, r22");
asm volatile ("in r0, 0x3d");
asm volatile ("std Z+5, r0");
asm volatile ("in r0, 0x3e");
asm volatile ("std Z+6, r0");
asm volatile ("movw r30, r24");
asm volatile ("ldd r0, Z+5");
asm volatile ("out 0x3d, r0");
asm volatile ("ldd r0, Z+6");
asm volatile ("out 0x3e, r0");
#endif
#if defined(__CHIBIOS_NIL__)
asm volatile ("movw r30, r22");
asm volatile ("in r0, 0x3d");
asm volatile ("std Z+0, r0");
asm volatile ("in r0, 0x3e");
asm volatile ("std Z+1, r0");
asm volatile ("movw r30, r24");
asm volatile ("ldd r0, Z+0");
asm volatile ("out 0x3d, r0");
asm volatile ("ldd r0, Z+1");
asm volatile ("out 0x3e, r0");
#endif
asm volatile ("pop r29");
asm volatile ("pop r28");
asm volatile ("pop r17");
asm volatile ("pop r16");
asm volatile ("pop r15");
asm volatile ("pop r14");
asm volatile ("pop r13");
asm volatile ("pop r12");
asm volatile ("pop r11");
asm volatile ("pop r10");
asm volatile ("pop r9");
asm volatile ("pop r8");
asm volatile ("pop r7");
asm volatile ("pop r6");
asm volatile ("pop r5");
asm volatile ("pop r4");
asm volatile ("pop r3");
asm volatile ("pop r2");
asm volatile ("ret");
}
to replace the existing _port_switch() function. The problem was that "_CHIBIOS_RT_" changed in "__CHIBIOS_RT__" in latest release. This fix will be included in 21.6.1, committed on repository.
Giovanni
Who is online
Users browsing this forum: No registered users and 14 guests