Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/actions/pio-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This action build thanks PIO.

## Inputs

### `cmsis-version`

The CMSIS version to use. Default `"5.9.0"`.

## Example usage

```yaml
Expand Down
6 changes: 6 additions & 0 deletions .github/actions/pio-build/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# action.yml
name: 'PlatformIO Build'
description: 'Compile using PlatformIO'
inputs:
cmsis-version:
description: 'CMSIS package version to use'
default: '5.9.0'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.cmsis-version }}
15 changes: 12 additions & 3 deletions .github/actions/pio-build/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh

readonly CMSIS_VERSION="$1"
readonly CMSIS_ARCHIVE="CMSIS-${CMSIS_VERSION}.tar.bz2"

# Use python venv
python3 -m venv "$HOME/venv"
# shellcheck disable=SC1091
Expand All @@ -8,18 +11,24 @@ python3 -m venv "$HOME/venv"
python3 -m pip install --quiet --upgrade platformio

# Install the development version of ststm32 platform
pio pkg install --platform "https://github.com/platformio/platform-ststm32.git" --force --global || {
platformio platform install "https://github.com/platformio/platform-ststm32.git" || {
exit 1
}
# Prepare framework for CI
# Modify platform.json to use local framework-arduinoststm32 package
python3 -c "import json; import os; fp=open(os.path.expanduser('~/.platformio/platforms/ststm32/platform.json'), 'r+'); data=json.load(fp); data['packages']['framework-arduinoststm32']['version'] = '*'; del data['packages']['framework-arduinoststm32']['owner']; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()" || {
exit 1
}
# Create symbolic link to the framework-arduinoststm32 package pointing to the repository workspace

ln --symbolic "$GITHUB_WORKSPACE" "$HOME/.platformio/packages/framework-arduinoststm32" || {
exit 1
}
# Download and unpack CMSIS package
wget --no-verbose "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/$CMSIS_VERSION/$CMSIS_ARCHIVE" || {
exit 1
}
tar --extract --bzip2 --file="$CMSIS_ARCHIVE" || {
exit 1
}
cd "$GITHUB_WORKSPACE/CI/build/" || {
exit 1
}
Expand Down
4,000 changes: 2,004 additions & 1,996 deletions boards.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cores/arduino/HardwareSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
void serialEventLP2() __attribute__((weak));
#endif
#if defined(HAVE_HWSERIALLP3)
HardwareSerial SerialLP3(LPUART3);
HardwareSerial SerialLP2(LPUART3);
void serialEventLP3() __attribute__((weak));
#endif
#endif // HAVE_HWSERIALx
Expand Down
34 changes: 34 additions & 0 deletions libraries/SrcWrapper/src/stm32/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1149,19 +1149,22 @@ void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart)
* @param None
* @retval None
*/
#ifndef HAL_DISABLE_USART1_IRQHANDLER
#if defined(USART1_BASE)
void USART1_IRQHandler(void)
{
HAL_NVIC_ClearPendingIRQ(USART1_IRQn);
HAL_UART_IRQHandler(uart_handlers[UART1_INDEX]);
}
#endif
#endif

/**
* @brief USART 2 IRQ handler
* @param None
* @retval None
*/
#ifndef HAL_DISABLE_USART2_IRQHANDLER
#if defined(USART2_BASE)
void USART2_IRQHandler(void)
{
Expand All @@ -1176,12 +1179,14 @@ void USART2_IRQHandler(void)
#endif
}
#endif
#endif

/**
* @brief USART 3 IRQ handler
* @param None
* @retval None
*/
#ifndef HAL_DISABLE_USART3_IRQHANDLER
#if defined(USART3_BASE)
void USART3_IRQHandler(void)
{
Expand Down Expand Up @@ -1231,26 +1236,30 @@ void USART3_IRQHandler(void)
#endif /* STM32F091xC || STM32F098xx */
}
#endif
#endif

/**
* @brief UART 4 IRQ handler
* @param None
* @retval None
*/
#ifndef HAL_DISABLE_UART4_IRQHANDLER
#if defined(UART4_BASE)
void UART4_IRQHandler(void)
{
HAL_NVIC_ClearPendingIRQ(UART4_IRQn);
HAL_UART_IRQHandler(uart_handlers[UART4_INDEX]);
}
#endif
#endif

/**
* @brief USART 4/5 IRQ handler
* @param None
* @retval None
*/
#if defined(STM32L0xx)
#ifndef HAL_DISABLE_UART4_5_IRQHANDLER
#if defined(USART4_BASE) || defined(USART5_BASE)
void USART4_5_IRQHandler(void)
{
Expand All @@ -1264,13 +1273,15 @@ void USART4_5_IRQHandler(void)
}
#endif
#endif
#endif

/**
* @brief USART 4 IRQ handler
* @param None
* @retval None
*/
#if defined(STM32U0xx)
#ifndef HAL_DISABLE_USART4_IRQHANDLER
#if defined(USART4_BASE)
void USART4_IRQHandler(void)
{
Expand All @@ -1286,147 +1297,170 @@ void USART4_IRQHandler(void)
}
#endif
#endif
#endif

/**
* @brief USART 5 IRQ handler
* @param None
* @retval None
*/
#ifndef HAL_DISABLE_USART5_IRQHANDLER
#if defined(UART5_BASE)
void UART5_IRQHandler(void)
{
HAL_NVIC_ClearPendingIRQ(UART5_IRQn);
HAL_UART_IRQHandler(uart_handlers[UART5_INDEX]);
}
#endif
#endif

/**
* @brief USART 6 IRQ handler
* @param None
* @retval None
*/
#ifndef HAL_DISABLE_USART6_IRQHANDLER
#if defined(USART6_BASE) && !defined(STM32F0xx) && !defined(STM32G0xx)
void USART6_IRQHandler(void)
{
HAL_NVIC_ClearPendingIRQ(USART6_IRQn);
HAL_UART_IRQHandler(uart_handlers[UART6_INDEX]);
}
#endif
#endif

/**
* @brief LPUART 1 IRQ handler
* @param None
* @retval None
*/
#ifndef HAL_DISABLE_LPUART1_IRQHANDLER
#if defined(LPUART1_BASE)
void LPUART1_IRQHandler(void)
{
HAL_NVIC_ClearPendingIRQ(LPUART1_IRQn);
HAL_UART_IRQHandler(uart_handlers[LPUART1_INDEX]);
}
#endif
#endif

/**
* @brief UART 7 IRQ handler
* @param None
* @retval None
*/
#ifndef HAL_DISABLE_UART7_IRQHANDLER
#if defined(UART7_BASE)
void UART7_IRQHandler(void)
{
HAL_NVIC_ClearPendingIRQ(UART7_IRQn);
HAL_UART_IRQHandler(uart_handlers[UART7_INDEX]);
}
#endif
#endif

/**
* @brief UART 8 IRQ handler
* @param None
* @retval None
*/
#ifndef HAL_DISABLE_UART8_IRQHANDLER
#if defined(UART8_BASE)
void UART8_IRQHandler(void)
{
HAL_NVIC_ClearPendingIRQ(UART8_IRQn);
HAL_UART_IRQHandler(uart_handlers[UART8_INDEX]);
}
#endif
#endif

/**
* @brief UART 9 IRQ handler
* @param None
* @retval None
*/
#ifndef HAL_DISABLE_UART9_IRQHANDLER
#if defined(UART9_BASE)
void UART9_IRQHandler(void)
{
HAL_NVIC_ClearPendingIRQ(UART9_IRQn);
HAL_UART_IRQHandler(uart_handlers[UART9_INDEX]);
}
#endif
#endif

/**
* @brief UART 10 IRQ handler
* @param None
* @retval None
*/
#ifndef HAL_DISABLE_UART10_IRQHANDLER
#if defined(UART10_BASE)
void UART10_IRQHandler(void)
{
HAL_NVIC_ClearPendingIRQ(UART10_IRQn);
HAL_UART_IRQHandler(uart_handlers[UART10_INDEX]);
}
#endif
#endif

/**
* @brief USART 10 IRQ handler
* @param None
* @retval None
*/
#ifndef HAL_DISABLE_USART10_IRQHANDLER
#if defined(USART10_BASE)
void USART10_IRQHandler(void)
{
HAL_NVIC_ClearPendingIRQ(USART10_IRQn);
HAL_UART_IRQHandler(uart_handlers[UART10_INDEX]);
}
#endif
#endif

/**
* @brief USART 11 IRQ handler
* @param None
* @retval None
*/
#ifndef HAL_DISABLE_USART11_IRQHANDLER
#if defined(USART11_BASE)
void USART11_IRQHandler(void)
{
HAL_NVIC_ClearPendingIRQ(USART11_IRQn);
HAL_UART_IRQHandler(uart_handlers[UART11_INDEX]);
}
#endif
#endif

/**
* @brief UART 12 IRQ handler
* @param None
* @retval None
*/
#ifndef HAL_DISABLE_UART12_IRQHANDLER
#if defined(UART12_BASE)
void UART12_IRQHandler(void)
{
HAL_NVIC_ClearPendingIRQ(UART12_IRQn);
HAL_UART_IRQHandler(uart_handlers[UART12_INDEX]);
}
#endif
#endif

/**
* @brief HAL UART Call Back
* @param UART handler
* @retval None
*/
#ifndef HAL_DISABLE_UART_WAKEUPCALLBACK
void HAL_UARTEx_WakeupCallback(UART_HandleTypeDef *huart)
{
serial_t *obj = get_serial_obj(huart);
HAL_UART_Receive_IT(huart, &(obj->recv), 1);
}
#endif

/**
* @brief Function called to set the uart clock prescaler
Expand Down
6 changes: 0 additions & 6 deletions libraries/USBDevice/inc/usbd_cdc_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ void CDC_deInit(void);
bool CDC_connected(void);
void CDC_enableDTR(bool enable);

// getters for CDC line codings. Do not expose struct directly
uint32_t CDC_getBaudrate(void);
uint8_t CDC_getStopBits(void);
uint8_t CDC_getParity(void);
uint8_t CDC_getDataBits(void);

#ifdef __cplusplus
}
#endif
Expand Down
12 changes: 4 additions & 8 deletions libraries/USBDevice/src/USBSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,26 +158,22 @@ void USBSerial::flush(void)

uint32_t USBSerial::baud()
{
// return (virtual) CDC line setting coding
return CDC_getBaudrate();
return 115200;
}

uint8_t USBSerial::stopbits()
{
// return (virtual) CDC line setting coding
return CDC_getStopBits();
return ONE_STOP_BIT;
}

uint8_t USBSerial::paritytype()
{
// return (virtual) CDC line setting coding
return CDC_getParity();
return NO_PARITY;
}

uint8_t USBSerial::numbits()
{
// return (virtual) CDC line setting coding
return CDC_getDataBits();
return 8;
}

void USBSerial::dtr(bool enable)
Expand Down
Loading