Works properly with waking from interruptin, not from timeout from
regular sleep, but thats the nature of the current KSDK Ticker timer
used, can be changed later on :)
The original code switched ADC clock source depending on required
prescaler. Maybe thats possible on K64, but on K22 it just tried to set
clock to non-existing source. Not it gets a bit above MAX_ADC, but that
is set fairly conservative so is not an issue.
- Linker script and startup for Nucleo_F411 - both are copies of
Nucleo_F401 with some changes (memory size, interrupt vector table)
- changes in target.py for the new toolchain
First part was pinouts. Second part is that the earlier done new I2C
commands were wrong. The macros for writing for example status register
expect the I2C base address, and were only getting the number of the i2c
peripheral. After figuring that one out technically the changes in
timeout_status_poll aren't necesary, but it won't hurt either.
The green LED is by default on. It is part of the JTAG interface,
although then it should be high-Z. Whatever the exact reason, it bothers
me. This disables it at startup (by switching the pin to GPIO).
Apparantly the wrong CPU was set, fixed that to correct one
(MK22F51212). Won't hurt though if someone checks the .s and .sct file.
(It does compile and work fine now for blinky and helloworld)
First part is pretty obvious, added some pin defines, and some ifdefs in
serial_api.c to make it compile (they all use KSDK macros, so goes
automatically, and not that many ifdefs).
Second part is that in the new version of the hal files you apparantly
got to manually enable the uart transmitter/receiver. This wasn't in
there yet, so it did very little.
Now it works fine on a K22F (well minus the part where the first char in
a program isn't transmitted, but thats alot better than nothing being
transmitted)
And that is a bit of an overstatement. But mbed blinky works :D. And
nothing else works atm. Still more than before today.
Every option in device.h is disabled (and won't work), but now they can
slowly be enabled (they will need pinouts and most some will need some
changes in the mbed api files).
One of the major issues was that the KSDK is intended to only compile
relevant peripherals, but the mbed build system does not support this.
So now for the affected peripherals (with the K22F and K64F) instead of
throwing an error when no valid CPU is found for them, it sets a define,
and the relevant .h and .c files have an #ifndef for that define. This
way it doesn't need to be manually set for each mbed target.