Skip to content

Commit

Permalink
Add STM U585I (#374)
Browse files Browse the repository at this point in the history
* Add STM U585I

* add U5 workflow

* add u5 to main readme

* output MAC and FW version from device
  • Loading branch information
ryanwinter authored Feb 14, 2023
1 parent 47fbb9c commit 1d86714
Show file tree
Hide file tree
Showing 485 changed files with 672,011 additions and 4 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/U585I-IOT02A.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: U585I-IOT02A

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

defaults:
run:
working-directory: STMicroelectronics/B-U585I-IOT02A

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
type: [Debug, Release]

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive

- name: arm-none-eabi-gcc
uses: ryanwinter/arm-none-eabi-gcc@master
with:
release: '10-2021.10'

- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@v3

- name: Build binary
run: |
cmake -Bbuild -GNinja -DCMAKE_TOOLCHAIN_FILE="../../cmake/arm-gcc-cortex-m33.cmake" -DCMAKE_BUILD_TYPE="${{ matrix.type }}"
cmake --build build
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The following guides will get you started:
|[Silicon Labs EFR32MG12](SiliconLabs/EFR32MG12)|![](https://github.com/azure-rtos/getting-started/actions/workflows/EFR32MG12.yml/badge.svg)||
|[STMicroelectronics B-L475E-IOT01A](STMicroelectronics/B-L475E-IOT01A)|![](https://github.com/azure-rtos/getting-started/actions/workflows/L475E-IOT01A.yml/badge.svg)|
|[STMicroelectronics B-L4S5I-IOT01A](STMicroelectronics/B-L4S5I-IOT01A)|![](https://github.com/azure-rtos/getting-started/actions/workflows/L4S5I-IOT01A.yml/badge.svg)|
|[STMicroelectronics B-U585I-IOT02A](STMicroelectronics/B-U585I-IOT02A)|![](https://github.com/azure-rtos/getting-started/actions/workflows/U585I-IOT02A.yml/badge.svg)|

**Build Status:** A GitHub workflow building on Windows & Linux.

Expand Down
4 changes: 2 additions & 2 deletions Renesas/RX65N_Cloud_Kit/app/rx_networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ UINT rx_network_init(CHAR* ssid, CHAR* password, WiFi_Mode mode)
{
nx_dns_delete(&nx_dns_client);
nx_ip_delete(&nx_ip);
nx_packet_pool_delete(&nx_pool);
nx_packet_pool_delete(&nx_pool);
printf("ERROR: Failed to init the SNTP client (0x%08x)\r\n", status);
}

Expand Down Expand Up @@ -270,7 +270,7 @@ UINT rx_network_connect()
// Force a disconnect
R_WIFI_SX_ULPGN_Disconnect();

// Obtain the IP internal mutex before reconnecting WiFi
// Obtain the IP internal mutex before reconnecting WiFi
join_result = R_WIFI_SX_ULPGN_Connect(netx_ssid, netx_password, netx_mode, 1, &ip_cfg);

tx_thread_sleep(5 * TX_TIMER_TICKS_PER_SECOND);
Expand Down
39 changes: 39 additions & 0 deletions STMicroelectronics/B-U585I-IOT02A/.vs/launch.vs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"version": "0.2.1",
"configurations": [
{
"project": "CMakeLists.txt",
"projectTarget": "stm32u585_azure_iot.elf (app\\stm32u585_azure_iot.elf)",
"name": "Launch",
"type": "cppdbg",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${debugInfo.fullTargetPath}",
"processName": "stm32u585_azure_iot",
"MIMode": "gdb",
"miDebuggerPath": "arm-none-eabi-gdb",
"miDebuggerServerAddress": "localhost:3333",
"debugServerPath": "openocd",
"debugServerArgs": "-f interface/stlink.cfg -f target/stm32u5x.cfg",
"serverStarted": "Listening on port .* for gdb connections",
"filterStderr": true,
//"stopAtConnect": true,
"stopOnEntry": true,
"svdPath": "${workspaceRoot}/STM32U5xx.svd",
"hardwareBreakpoints": {
"require": true,
"limit": 6
},
"postRemoteConnectCommands": [
{
"text": "-target-download",
"ignoreFailures": false
},
{
"text": "-interpreter-exec console \"monitor reset halt\"",
"ignoreFailures": false
}
]
}
]
}
23 changes: 23 additions & 0 deletions STMicroelectronics/B-U585I-IOT02A/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Cortex Debug",
"cwd": "${workspaceRoot}",
"executable": "${workspaceFolder}/build/app/stm32u585_azure_iot.elf",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
"runToMain": true,
"breakAfterReset": true,
// "showDevDebugOutput": true,
"configFiles": [
"interface/stlink.cfg",
"target/stm32u5x.cfg"
]
}
]
}
6 changes: 6 additions & 0 deletions STMicroelectronics/B-U585I-IOT02A/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"cmake.configureOnOpen": true,
"cmake.generator": "Ninja",
"cmake.buildDirectory": "${workspaceFolder}/build"
}
29 changes: 29 additions & 0 deletions STMicroelectronics/B-U585I-IOT02A/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Flash",
"type": "shell",
"command": "openocd -f interface/stlink.cfg -f target/stm32u5x.cfg -c \"program build/app/stm32u585_azure_iot.elf verify\" -c \"reset halt\" -c \"shutdown\"",
"problemMatcher": [],
// "dependsOn": [ "Build" ]
},
{
"label": "Build",
"type": "shell",
"command": "rebuild.bat",
"problemMatcher": "$gcc",
"group": {
"kind": "build",
"isDefault": true
},
// This must be commented out to run on Linux.
"options": {
"shell": {
"executable": "cmd.exe",
"args": [ "/c" ]
}
}
}
]
}
34 changes: 34 additions & 0 deletions STMicroelectronics/B-U585I-IOT02A/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
set(CMAKE_C_STANDARD 99)

set(GSG_BASE_DIR ${CMAKE_SOURCE_DIR}/../..)
set(SHARED_SRC_DIR ${GSG_BASE_DIR}/shared/src)
set(SHARED_LIB_DIR ${GSG_BASE_DIR}/shared/lib)

set(PROJECT stm32u585_azure_iot)

# use the repo version of ninja on Windows as there is no Ninja installer
if(WIN32)
set(CMAKE_MAKE_PROGRAM ${GSG_BASE_DIR}/cmake/ninja CACHE STRING "Ninja location")
endif()

# Set the toolchain if not defined
if(NOT CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "${GSG_BASE_DIR}/cmake/arm-gcc-cortex-m33.cmake")
endif()

include(${GSG_BASE_DIR}/cmake/utilities.cmake)

# Define the Project
# CXX enables IntelliSense only. Sources are still compiled as C.
project(${PROJECT} C CXX ASM)

# Disable common networking component, STM has it's own
set(DISABLE_COMMON_NETWORK true)

add_subdirectory(${SHARED_SRC_DIR} shared_src)
add_subdirectory(lib)
add_subdirectory(app)
33 changes: 33 additions & 0 deletions STMicroelectronics/B-U585I-IOT02A/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"version": 2,
"configurePresets": [
{
"name": "arm-gcc-cortex-m33",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install",
"CMAKE_TOOLCHAIN_FILE": {
"type": "FILEPATH",
"value": "${sourceDir}/../../cmake/arm-gcc-cortex-m33.cmake"
}
},
"architecture": {
"value": "unspecified",
"strategy": "external"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"intelliSenseMode": "linux-gcc-arm"
}
}
}
],
"buildPresets": [
{
"name": "arm-gcc-cortex-m33",
"configurePreset": "arm-gcc-cortex-m33"
}
]
}
43 changes: 43 additions & 0 deletions STMicroelectronics/B-U585I-IOT02A/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
page_type: sample
description: Connecting an STMicroelectronics B-U585I-IOT02A device to Azure IoT using Azure RTOS
languages:
- c
products:
- azure-iot
- azure-iot-pnp
- azure-rtos
---

# Connect an STMicroelectronics B-U585I-IOT02A Discovery kit to Azure IoT

[![Quickstart article](../../docs/media/docs-link-buttons/azure-quickstart.svg)](https://docs.microsoft.com/azure/iot-develop/quickstart-devkit-stm-b-l4s5i)
[![Documentation](../../docs/media/docs-link-buttons/azure-documentation.svg)](https://docs.microsoft.com/azure/iot-develop/)

The **Quickstart** button above provides the complete steps for creating an IoT Central application and then configuring, building and flashing the device.

For guidance on connecting additional devices, see the [Embedded device quickstarts](https://docs.microsoft.com/azure/iot-develop/quickstart-devkit-mxchip-az3166).

## What you need

* The [B-U585I-IOT02A devkit](https://www.st.com/en/evaluation-tools/b-u585i-iot02a.html)
* Wi-Fi 2.4 GHz
* USB 2.0 A male to Micro USB male cable

## Get the source code

1. Clone the repository:
```shell
git clone https://github.com/azure-rtos/getting-started.git
```

1. Add Wi-Fi and Azure IoT configuration to the config file:

*STMicroelectronics\B-U585I-IOT02A\app\azure_config.h*

1. Configure a serial port app at baud rate **115,200** to monitor the device output.

## STM32CubeMX configuration

The board specific code was creating using [STM32CubeMX](https://www.st.com/en/development-tools/stm32cubemx.html). The project file can be found in the [lib/stmcubeu5/stmcubemx]() directory if further customization is needed.

Loading

0 comments on commit 1d86714

Please sign in to comment.