Skip to content

Commit

Permalink
#7 Add example for STM32F4
Browse files Browse the repository at this point in the history
  • Loading branch information
rrusch committed May 12, 2024
1 parent 526ce4d commit 1be55cf
Show file tree
Hide file tree
Showing 493 changed files with 242,372 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[submodule "examples/stm32f1_usb_serial/Lib/Stm32Serial"]
path = examples/stm32f1_usb_serial/Lib/Stm32Serial
url = https://github.com/libsmart/Stm32Serial.git
[submodule "examples/stm32f1_usb_serial/Lib/Stm32Common"]
path = examples/stm32f1_usb_serial/Lib/Stm32Common
url = https://github.com/libsmart/Stm32Common.git
[submodule "examples/stm32f4_usb_serial/Lib/Stm32Common"]
path = examples/stm32f4_usb_serial/Lib/Stm32Common
url = https://github.com/libsmart/Stm32Common.git
[submodule "examples/stm32f4_usb_serial/Lib/Stm32ItmLogger"]
path = examples/stm32f4_usb_serial/Lib/Stm32ItmLogger
url = https://github.com/libsmart/Stm32ItmLogger.git
[submodule "examples/stm32f4_usb_serial/Lib/Stm32ThreadxThread"]
path = examples/stm32f4_usb_serial/Lib/Stm32ThreadxThread
url = https://github.com/libsmart/Stm32ThreadxThread.git
[submodule "examples/stm32f4_usb_serial/Lib/Stm32UsbX"]
path = examples/stm32f4_usb_serial/Lib/Stm32UsbX
url = https://github.com/libsmart/Stm32UsbX.git
1 change: 1 addition & 0 deletions examples/stm32f1_usb_serial/Lib/Stm32Common
Submodule Stm32Common added at 1debcf
1 change: 1 addition & 0 deletions examples/stm32f1_usb_serial/Lib/Stm32Serial
Submodule Stm32Serial added at e1672d
205 changes: 205 additions & 0 deletions examples/stm32f4_usb_serial/.cproject

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions examples/stm32f4_usb_serial/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
trim_trailing_whitespace = true

[{Core,Drivers,LWIP,Middlewares,USB_DEVICE}/**.{c,h}]
indent_size = 2
tab_width = 2

79 changes: 79 additions & 0 deletions examples/stm32f4_usb_serial/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

/git_rev_macro.txt
8 changes: 8 additions & 0 deletions examples/stm32f4_usb_serial/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions examples/stm32f4_usb_serial/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions examples/stm32f4_usb_serial/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions examples/stm32f4_usb_serial/.idea/stm32f4_usb_serial.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions examples/stm32f4_usb_serial/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions examples/stm32f4_usb_serial/.mxproject

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions examples/stm32f4_usb_serial/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>stm32f4_usb_serial</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.st.stm32cube.ide.mcu.MCUProjectNature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature</nature>
<nature>com.st.stm32cube.ide.mcu.MCUCubeProjectNature</nature>
<nature>com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature</nature>
<nature>com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature</nature>
<nature>com.st.stm32cube.ide.mcu.MCURootProjectNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
135 changes: 135 additions & 0 deletions examples/stm32f4_usb_serial/AZURE_RTOS/App/app_azure_rtos.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@

/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file app_azure_rtos.c
* @author MCD Application Team
* @brief azure_rtos application implementation file
******************************************************************************
* @attention
*
* Copyright (c) 2021 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */

/* Includes ------------------------------------------------------------------*/

#include "app_azure_rtos.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN PTD */

/* USER CODE END PTD */

/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */

/* USER CODE END PD */

/* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN PM */

/* USER CODE END PM */

/* Private variables ---------------------------------------------------------*/
/* USER CODE BEGIN TX_Pool_Buffer */
/* USER CODE END TX_Pool_Buffer */
static UCHAR tx_byte_pool_buffer[TX_APP_MEM_POOL_SIZE];
static TX_BYTE_POOL tx_app_byte_pool;

/* USER CODE BEGIN UX_Device_Pool_Buffer */
/* USER CODE END UX_Device_Pool_Buffer */
static UCHAR ux_device_byte_pool_buffer[UX_DEVICE_APP_MEM_POOL_SIZE];
static TX_BYTE_POOL ux_device_app_byte_pool;

/* USER CODE BEGIN PV */

/* USER CODE END PV */

/* Private function prototypes -----------------------------------------------*/
/* USER CODE BEGIN PFP */

/* USER CODE END PFP */

/**
* @brief Define the initial system.
* @param first_unused_memory : Pointer to the first unused memory
* @retval None
*/
VOID tx_application_define(VOID *first_unused_memory)
{
/* USER CODE BEGIN tx_application_define */

/* USER CODE END tx_application_define */

VOID *memory_ptr;

if (tx_byte_pool_create(&tx_app_byte_pool, "Tx App memory pool", tx_byte_pool_buffer, TX_APP_MEM_POOL_SIZE) != TX_SUCCESS)
{
/* USER CODE BEGIN TX_Byte_Pool_Error */

/* USER CODE END TX_Byte_Pool_Error */
}
else
{
/* USER CODE BEGIN TX_Byte_Pool_Success */

/* USER CODE END TX_Byte_Pool_Success */

memory_ptr = (VOID *)&tx_app_byte_pool;

if (App_ThreadX_Init(memory_ptr) != TX_SUCCESS)
{
/* USER CODE BEGIN App_ThreadX_Init_Error */

/* USER CODE END App_ThreadX_Init_Error */
}

/* USER CODE BEGIN App_ThreadX_Init_Success */

/* USER CODE END App_ThreadX_Init_Success */

}

if (tx_byte_pool_create(&ux_device_app_byte_pool, "Ux App memory pool", ux_device_byte_pool_buffer, UX_DEVICE_APP_MEM_POOL_SIZE) != TX_SUCCESS)
{
/* USER CODE BEGIN UX_Device_Byte_Pool_Error */

/* USER CODE END UX_Device_Byte_Pool_Error */
}
else
{
/* USER CODE BEGIN UX_Device_Byte_Pool_Success */

/* USER CODE END UX_Device_Byte_Pool_Success */

memory_ptr = (VOID *)&ux_device_app_byte_pool;

if (MX_USBX_Device_Init(memory_ptr) != UX_SUCCESS)
{
/* USER CODE BEGIN MX_USBX_Device_Init_Error */

/* USER CODE END MX_USBX_Device_Init_Error */
}

/* USER CODE BEGIN MX_USBX_Device_Init_Success */

/* USER CODE END MX_USBX_Device_Init_Success */
}
}

/* USER CODE BEGIN 0 */

/* USER CODE END 0 */
Loading

0 comments on commit 1be55cf

Please sign in to comment.