In the trunk, the current NIL demo for AVR do not compile any more, due to NIL evolution I suppose.
I look to differences against STM:
The file demo/AVR/NIL-ARDUINOUNO/nilconf.h need to be replace by demo/AVR/NIL-ARDUINOUNO/chconf.h
I then copied the file chconf.h from an STM demo and change the number of threads to 2 as it is in the AVR demo.
The line 18 in demo/AVR/NIL-ARDUINOUNO/main.c
Code: Select all
#include "nil.h"
is replaced by
Code: Select all
#include "chconf.h"
After compilation, at linking step, a get an error that shows me that NIL depends on RT . I thinks it must not be the case?
Here is the error:
Linking: ch.elf
avr-gcc -mmcu=atmega328p -I. -gdwarf-2 -DF_CPU=16000000UL -O2 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=../../../os/nil/src/ch.o -I../../../os/license -I../../../os/common/ports/AVR -I../../../os/common/ports/AVR/compilers/GCC -I../../../os/nil/include -I../../../os/common/oslib/include -I../../../test/lib -I../../../test/nil/source/test -I../../../os/hal/include -I../../../os/hal/osal/nil -I../../../os/hal/ports/AVR -I../../../os/hal/boards/ARDUINO_UNO -I../../../os/various -std=gnu11 -fdata-sections -ffunction-sections -Wundef -MMD -MP -MF .dep/ch.elf.d ../../../os/nil/src/ch.o ../../../os/common/oslib/src/chmboxes.o ../../../os/common/oslib/src/chmemcore.o ../../../os/common/oslib/src/chmempools.o ../../../os/common/oslib/src/chheap.o ../../../os/common/ports/AVR/chcore.o ../../../os/hal/osal/nil/osal.o ../../../os/hal/src/hal.o ../../../os/hal/src/hal_buffers.o ../../../os/hal/src/hal_queues.o ../../../os/hal/src/hal_mmcsd.o ../../../os/hal/src/hal_adc.o ../../../os/hal/src/hal_can.o ../../../os/hal/src/hal_dac.o ../../../os/hal/src/hal_ext.o ../../../os/hal/src/hal_gpt.o ../../../os/hal/src/hal_i2c.o ../../../os/hal/src/hal_i2s.o ../../../os/hal/src/hal_icu.o ../../../os/hal/src/hal_mac.o ../../../os/hal/src/hal_mmc_spi.o ../../../os/hal/src/hal_pal.o ../../../os/hal/src/hal_pwm.o ../../../os/hal/src/hal_qspi.o ../../../os/hal/src/hal_rtc.o ../../../os/hal/src/hal_sdc.o ../../../os/hal/src/hal_serial.o ../../../os/hal/src/hal_serial_usb.o ../../../os/hal/src/hal_spi.o ../../../os/hal/src/hal_st.o ../../../os/hal/src/hal_uart.o ../../../os/hal/src/hal_usb.o ../../../os/hal/src/hal_wdg.o ../../../os/hal/ports/AVR/hal_lld.o ../../../os/hal/ports/AVR/hal_pal_lld.o ../../../os/hal/ports/AVR/hal_serial_lld.o ../../../os/hal/ports/AVR/hal_adc_lld.o ../../../os/hal/ports/AVR/hal_ext_lld.o ../../../os/hal/ports/AVR/hal_i2c_lld.o ../../../os/hal/ports/AVR/hal_spi_lld.o ../../../os/hal/ports/AVR/hal_gpt_lld.o ../../../os/hal/ports/AVR/hal_pwm_lld.o ../../../os/hal/ports/AVR/hal_icu_lld.o ../../../os/hal/ports/AVR/hal_usb_lld.o ../../../os/hal/ports/AVR/hal_st_lld.o ../../../os/hal/boards/ARDUINO_UNO/board.o ../../../test/lib/ch_test.o ../../../test/nil/source/test/test_root.o ../../../test/nil/source/test/test_sequence_001.o ../../../test/nil/source/test/test_sequence_002.o ../../../test/nil/source/test/test_sequence_003.o ../../../test/nil/source/test/test_sequence_004.o ../../../test/nil/source/test/test_sequence_005.o ../../../test/nil/source/test/test_sequence_006.o main.o --output ch.elf -Wl,-Map=ch.map,--cref,--gc-sections -Wl,-u,vfprintf -lprintf_min -Wl,-u,vfscanf -lscanf_min -lm
../../../os/common/ports/AVR/chcore.o: In function `_port_thread_start':
/home/tfateba/Documents/chibios/nil-avr/demos/AVR/NIL-ARDUINOUNO/../../../os/common/ports/AVR/chcore.c:153: undefined reference to `chThdExit'
collect2: error: ld returned 1 exit status
Makefile:498: recipe for target 'ch.elf' failed
make: *** [ch.elf] Error 1
make: Leaving directory '/home/tfateba/Documents/chibios/nil-avr/demos/AVR/NIL-ARDUINOUNO'
The asm call to chThdExit cause the failure.
By commenting the line 153 in os/common/ports/AVR/chcore.c, everything build fine.
But the program execution is too fast, an Helloworld message must be send to the serial console every 2 second, but I see it every 10ms. The same for the LED!
What do we need to do to resolve the problem?
Thanks.