Thread - stack methods are not available for now, as tcb pointer was removed from
internal structure. To obtain it, we could get it from the kernel, but this should be
reconsidered. Either RTOS should provide it, or these methods will become deprecated.
Changes to the original kernel:
Cortex-M requires to define __CMSIS_OS_RTX, and __MBED_CMSIS_RTOS_CM. The macro __MBED_CMSIS_RTOS_CM
is mbed specific macro, to track changes to the kernel. This should keep us aware what has changed. For instance,
one breaking change was thread adding instances variable, which were not in mbed. This can be find as
it's protected via __MBED_CMSIS_RTOS_CM ifdef.
```
// added for mbed compatibility
// original RTX code
```
Startup for toolchains - mbed defines own stack pointer (set_main_stack()), therefore it should be called in the startup.
IAR added low level init calls and dynamic intialization to the IAR startup. All defined in RTX_CM_lib.h.
The timer thread has task id 0x01, main task 0x02. There are exception for main task not to check for
overflows. This is mbed specific, was reapplied from mbed code base.
IAR fixed SVC calls, this fix had to be reapplied (repo mbed PR 736 for more information).
There are 28 filter banks which are shared between CAN1 and CAN2. By default
they are divided in half:
* CAN1 -> 0 ... 13
* CAN2 -> 14 ... 27
that's why we need to decied which filter number has to be chosen.
Change-Id: If5f0da035c1435c61d4748b12d6617e9005cfd83
For some reason STACKHEAP block was placed in SRAM2 section which lead to
*Error[Lp011]: section placement failed - unable to allocate space for sections/
block* error. This patch modifies the STM32L4 linker script and places STACKHEAP
into SRAM1 section which was previously unused.
Change-Id: Ibe6ca52a9fe7af232a3eade2f6b1f2ce28c9bd49
Introducing the prescaler management allows a wider period range support,
from about 65ms before now up to about 32s. We're also introducing
asserts in case the period or prescaler is truncated as the HW registers
are 16 bits large.
* [STM32F4 STM32F7] Overwrite HAL_Delay to allow SD example
The weak function HAL_Delay is overwritten to use us ticker API.
The user can use stm32f[4/7]xx_hal_sd.c that calls
HAL_Delay
This will allow us to add an example detecting / writing / reading an SD
card on DISCO_F469NI and DISCO_F746NG
(cherry picked from commit d491e3cd8b)
Our UART doesn't have the ability to send a break, so we make the TX a GPIO and drive it low during the break_set() and then release it back to the UART in the break_clear().
The RPC call appended the method name to the output after the method
had already finished processing. It was unexpected for my use case,
and doesn't feel like the obvious thing to do. This could be appended
in the RPC method itself, instead.
The adding of the method to the output was first commited in commit
556b889b5f.
* * Base Commit for SAMG55J19. No errors and no implementations.
* * Added gpio files.
* * Added pinmap files.
* * Base commit for usticker implementation.
* * Added gcc_arm export functionality
* * added files for usticker.
* added template file for samd55j19
* * GPIO IRQ base commit.
* * updated with changes in gpio irq driver.
* * Reverted back unexpected commit in SAM0 gpio driver.
* * updated gpio_irq driver.
* * correction in gpio and gpio_irq drivers.
* added support for some test for gpio.
* * base commit for peripheralpins for usart.
* update in serial apis.
* * updated serial apis.
* * updated serial apis and test.
* * update serial apis for asynch apis.
* * updated peripheral pins for i2c and spi.
* added test support for serial flow control
* * Base commit for low power ticker implementation.
* * base commit for port apis.
* update in lp ticker apis.
* * Added test support for port.
* * base commit for sleep apis.
* * Base commit for spi.
* * updated with corrections in gpio irq.
* usticker file updated with latest source.
* * updated with corrections for unexpected board reset.
* updated gpio irq apis and added test for the same.
* * updated sleep api for deepsleep.
* * updated serial apis.
* Added uc_ticker and SPI api implementations
* Removed unused SPI pin map
* Updated review feedback
* * implemented lpticker with TC module.
* updated files for KnR Coding Statndard.
* updated serial and usticker apis.
* * Base commit for AnalogueIn apis.
* * RTC apis base commit without implementation.
* * Updated with corrections in lpticker implementations.
* * Added implementation for rtc apis.
* * updated with implementations for pwm.
* changed usticker from TC0 to TC1.
* Added I2C support
* * removed setvector usage from usticker and lpticker implementations
* added tests for SAMG55J19
* * Removed unwanted .o and .d files.
* Updated I2C files for KnR Coding Standards.
* Update for reducing compiler warnings in peripheralpins,c
* Updated with PWM free implementation.
* * Removed unwanted headers file inclusion.
* Compiler warning corrections in serial_api.c
* * Updated ADC with 16 bit mode initialization and code refinements.
* Updated PWM with code refinements.
* Updated I2C review feedback and fixed style
* Updated target name for SAMG55
* * Added Test Support for I2C with AT30TSE75X and Added Support for SAMG55J19 in atmelstudio project exporter
* * Added Test Support for I2C with AT30TSE75X and Added Support for SAMG55J19 in atmelstudio project exporter
* Used NVIC_SetVector for interrupt callback
* Removed Target macro define in test
* Updated test cases to have SAMG55 support
* * Updated with corrections in Serial and SPI asynchronous implementations.
* Updated deepsleep api implementation
* Merged LP_Ticker with latest code from mbed 3.0 repository.
* * updated with corrections in I2C Asynch implementation.
When a ticker is scheduled to run so fast that it is pending again
before the previous event has been processed then this next event
is processed (recursively) by calling into us_ticker_irq_handle().
This can lead to a stack overflow.
This patch prevents this recursion by replacing the call to
us_ticker_irq_handler() with a call to set the interrupt to pending
again. This allows the next timer event to be processed without
making the stack deeper.
Add a delay after switching to the FEE clock mode so the FLL has a
chance to acquire a better lock. This fixes a bug where the first byte
sent over the UART is corrupt.
UART_IT_TC was enabled instead of UART_IT_TXE
This was causing an issue because UART_IT_TXE (and not UART_IT_TC) was disabled by same function.
Consequently if a transfer was ongoing when serial_irq_set() was called to disable IRQ, UART_IT_TC would still trigger (once).
Side effect is maybe speed: I guess using UART_IT_TC prevented implementation of continuous transfer.
This commit is focused on solving an issue observed with TARGET_STM32F4. It doesn't presume it should or shouldn't be done for other targets.
My previous commit, c6d2c81, broke Keil builds and maybe even IAR.
I need to learn how to read C code :) I thought I was masking off the
O_BINARY bit only for GCC builds but it turns out that my update was
in the fall-through case for all toolchains. This commit now places
the O_BINARY masking operation into a GCC specific #ifdef clause.
Testing:
I tested the same fopen("/local/out.txt","rb") code as before but this
time I built it with the online compiler and GCC_ARM. I tested the
resulting binaries on mbed-LPC11U24 and mbed-LPC1768 boards.
Thanks to @neilt6 for catching & reporting this!
Adding additional 'defined' statements to line 62 of parse_pins.cpp should in theory enable the rpc libraries for all other Nucleo boards, since all stm32 parts use the same pin labeling scheme i.e. P(port)_pinNumber e.g. PA_3,
PC_15 e.t.c.
Fixes issue #1562 reported by @justbuchanan.
When building code with GCC-ARM / newlib, attempting to use the
b (binary) mode in a fopen() call would fail. newlib would parse
this option and pass it down to the LocalFileSystem open call which
didn't like the unexpected O_BINARY flag in openmode.
The openmode_to_posix() function in retarget.cpp would never set the
O_BINARY flag for the other toolchains but for GCC it would just pass
down whatever newlib placed there. This commit masks out the O_BINARY
bit so that it never gets passed down to the file system drivers, just
as occurs for the other supported toolchains.
Test case:
FILE *fp = fopen("/local/out.txt", "rb");
I tested that code on mbed LPC1768 and LPC11U24 boards while using
GCC_ARM as the toolchain. It failed on both platforms previous to
this change and succeeded there after.
UDP based protocols such as DTLS may fragment large packets, resulting
in many packets being sent at once. This can lead to significant/irrecoverable
packet loss on systems that respond to packets slower than network transfers.
Increasing MEMP_NUM_NETBUF to 8 allows lwip to handle a DTLS handshake
successfully and should be more robust for similar protocols.
DTLS handshake:
https://tools.ietf.org/html/rfc4347#section-4.2.3