The rp2040 doesn't have a chip ID, but the flash chip connected does. We
can get this ID by asking the flash chip directly, but doing so requires
disengaging the XIP layer, performing the interrogation of the flash
chip, and then re-enabling the XIP layer. This gives us a 64-bit unique
ID that we can use as our USB serial number.
Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
In binutils 2.36 and above the -nostartfiles option is no longer
ignored. -nostartfiles is actually a gcc option, and so isn't supported
by ld. Earlier versions of binutils however had less error checking, and
thus just ignored the option.
Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
Support the rp2040 (as tested on a Raspberry Pi Pico board). This
adds basic uart, timer, gpio, and watchdog support.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use CONFIG_MACH_AVR instead of CONFIG_CLOCK_FREQ to check for slow
mcus. Some fast MCUs do not export a high clock frequency.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Add menuconfig option for stm32f072
* Add support for internal temp of stm32f072
* Share the temperature calculation logic between stm32f0x2 MCUs
Signed-off-by: Erik Henriksson <erikhenrikssn@gmail.com>
This reverts commit 70ea0806d9.
The above commit breaks software spi on linux hosts. Revert that
commit until an improved error check can be implemented.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit 6a3c357a incorrectly disabled support for USART3 on stm32f1 and
stm32f2 - restore that support.
Also, add support for USART3 on PD9/PD8 on stm32f103.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
These commands were never used by the main code and are not
particularly helpful for debugging. Remove them to reduce code size -
in particular on the pru architecture.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit ae89a659 caused a regression in the lpc176x UART handling.
After that commit the UART clock divisor would need to be 6.25 on
lpc1768 or 7.5 on lpc1769, but the code only supports whole numbers.
Set the PCLKSELx registers at startup and return to using full speed
peripheral clocks.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
On architectures that poll for irqs, check for any pending irqs prior
to checking if tasks are idle.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The timer_read_time() call can be expensive - when the next timer is
definitely pending, avoid making that call.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Implement rescheduling math using the simple 32-bit timer instead of
the Unix timespec struct. This makes the code simpler and doesn't
adversely impact the overall performance.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Some bootloaders do not disable peripherals in use before jumping to the application. Reset peripherals to assure correct operation.
SIgned-off-by: Eric Callahan <arksine.code@gmail.com>
This adds hardware PWM support for STM32F1 processors.
This should also work for STM32 F0/F2/F4 processors, but I
don't have one of those to test it.
Signed-off-by: Michael Kurz <michi.kurz@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The lpc176x has an errata that could cause updates to PCLKSELx to not
take effect. Rework the code to use the default peripheral clock
speed (25Mhz or 30Mhz) so that this register does not need to be
updated at runtime.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>