I am new to ChibiOS and trying to port the current (Github master) branch to Teensy3.1; my goals are to have: I2C master/slave (Tsy3.1 <=> Tsy3.1), SPI master, USB slave, ADC, PWM, and Flash (EEPROM-like operations) working.
Since there is already some support for the Teensy3.0, I thought it would be quite easy to run the demo... Well, not so easy after all: Teensy3.0 uses a K20_50 CPU (MK20DX128VLH5) while Teensy3.1 uses a K20_72 CPU (MK20DX256VLH7). There's a more complete list of the differences on the official website: https://www.pjrc.com/teensy/teensy31.html.
My main problem was the Vector table is not the same (46 IRQ for Tsy3.0, 94 for Tsy3.1). The exisiting code in the K20x folders specializes for the K20D5 family. Fixing that led me to create new subfolders (I now have K20x, K20D7, KL2x) into the KINETIS folders. The demo is running fine now (with the TestThread) but I don't think this is the right way to go... Most of the HAL code will be the same for both boards (3.0 and 3.1); the differences will be in clock initialization, Vector tables and available peripherals (more DMA, more I2C/SPI, CAN,DAC... on the Teensy3.1).
I guess there is a way to keep it simple but I don't really know how you want to do that.
Also, the TestThread fails on both Teensy3.0 and Teensy3.1, on one testcase:
Code: Select all
--- Test Case 1.4 (Threads, delays)
--- Result: FAILURE (#1 )
I don't know why nor how to fix that, and delays looks like they are fine (The Onboard LED blinks at a correct rate, checked with an analog scope). l I had to disable LTO in the Makefiles for the demo to compile... I don't know if that's why it fails now.
I join the diff file to this post in case it helps; sorry for the mess
Any advice or help is welcome; until then, I will keep working on my folder so it doesn't invades the upstream code.
Thanks for ChibiOS, awesome project !