Giter Site home page Giter Site logo

stmicroelectronics / x-cube-azrtos-f4 Goto Github PK

View Code? Open in Web Editor NEW
42.0 14.0 24.0 23.16 MB

X-CUBE-AZRTOS-F4 (Azure RTOS Software Expansion for STM32Cube) provides a full integration of Microsoft Azure RTOS in the STM32Cube environment for the STM32F4 series of microcontrollers.

Home Page: https://www.st.com/en/embedded-software/x-cube-azrtos-f4.html

License: Other

HTML 2.03% C 87.49% Assembly 9.03% CSS 0.13% CMake 0.22% PowerShell 0.29% Python 0.01% JavaScript 0.01% C++ 0.03% Batchfile 0.75% Makefile 0.01% Shell 0.01%
threadx stm32f4 filex azure-rtos x-cube netxduo usbx levelx

x-cube-azrtos-f4's Introduction

X-CUBE-AZRTOS-F4 Azure RTOS Software Expansion for STM32Cube

latest tag

With Azure RTOS complementing the extensive STM32Cube ecosystem providing free development tools, software bricks, and software expansion packages, STM32 users can also leverage the rich services of Azure RTOS, which meet the needs of tiny, smart, connected devices.

X-CUBE-AZRTOS-F4 (Azure RTOS Software Expansion for STM32Cube) provides a full integration of Microsoft Azure RTOS in the STM32Cube environment for the STM32F4 series of microcontrollers. Ready-to-run applicative examples are also provided for the NUCLEO-F429ZI and STM32469I-DISCO evaluation boards, thus reducing the learning curve and ensuring a smooth application development experience with Azure RTOS and STM32F4 MCUs.

The scope of this package covers the following Azure RTOS middleware: RTOS (ThreadX), USB Device and Host (USBX), File System including NOR/NAND memories support (FileX and LevelX) and Networking including Ethernet and WiFi media (NetXDuo).

Azure RTOS is a professional grade, highly reliable and market proven Middleware suite:

  • Integrated and full featured RTOS. Learn more ThreadX.
  • Industrial grade networking stack: optimized for performance coming with many IoT protocols. Learn more Netx Duo
  • Advanced FS/FTL: fully featured to support NAND/NOR Flash memories. Learn more FileX and LevelX
  • USB Host and Device stacks coming with multiple classes. Learn more USBX
  • Safety pre-certifications (from Microsoft): IEC 61508 SIL4, IEC 62304 Class C and ISO 26262 ASIL D
  • Security pre-certifications (from Microsoft): EAL4+ for TLS/DTLS, FIPS 140-2 for SW crypto lib
  • STM32 granted production license: here

Prerequisites

  • USBX, FileX and NetXDuo building require ThreadX as they are based on RTOS model.
  • USBX Host MSC requires FileX Middleware usage
  • USBX Device ECM/RNDIS classes require NetXDuo usage

One of the following toolchains:

  • IAR Embedded Workbench for ARM (EWARM)toolchain 8.50.9 + ST-LINKV3.
  • STM32CubeIDE V1.9.0 + ST-LINKV3
  • RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.32 + ST-LINKV3

Supported Devices and Boards

Repository structure

The STMicroelectronics GitHub X-CUBE-AZRTOS repository consists of the following repositories:

  • Drivers: contains STM32F4 CMSIS, HAL and BSP drivers
  • Middlewares: contains ThreadX, NetX Duo, FileX, LevelX and USBX stacks including porting on STM32 hardware
  • Projects: provides ready-to-run applicative examples for Azure RTOS on the supported boards. Projects are structured as follows:

Documentation

More comprehensive documentation is available on STM32 MCU Wiki.

License

Azure RTOS is distributed by Microsoft under GitHub and under Microsoft license. STMicroelectronics include Azure RTOS in selected STM32Cube software packages, whether delivered by Microsoft under GitHub, or by STMicroelectronics through STM32 CubeFW packages on www.st.com or GitHub, proprietary license terms are the same between Microsoft and User:

  • Source code is available
  • User is granted modification
  • User is granted redistribution of source (modified or not) and/or binary, provided he develops on an MCU/MPU that is listed officially by Microsoft
  • User is granted production, provided he develops on an MCU that is listed officially by Microsoft: Licensed Hardware
  • User is forbidden to reuse provided software to create a competing offer Whenever a new STM32 series includes support for Azure RTOS, it is added by Microsoft in the official list

By using STM32F4 Series you inherit the “Distribution and Production Use” rights in Section 2 of the Microsoft Software License Terms for Azure RTOS.

For more details about license information relative to each component in this package, please refer to LICENSE

Release note

Details about the content of this release are available in the release note here.

Applications

Middleware Applications Short Description
ThreadX Tx_Thread_Creation It demonstrates how to create and destroy multiple threads using Azure RTOS ThreadX APIs. In addition, it shows how to use preemption threshold between threads and change priorities on-fly. readme
ThreadX Tx_Thread_Sync It demonstrates how to synchronize between threads using binary semaphores or mutexes. readme
ThreadX Tx_Thread_MsgQueue It demonstrates how to exchange message between threads using Message Queue API and how to handle message from different queues using event queue chaining feature. readme
ThreadX Tx_FreeRTOS_Wrapper It demonstrates how to create threads using the FreeRTOS wrapper APIs. readme
ThreadX Tx_CMSIS_Wrapper It demonstrates how CMSIS RTOS adaptation layer for Azure RTOS ThreadX, it shows how to develop an application using the CMSIS RTOS 2 APIs. readme
ThreadX Tx_LowPower It demonstrates how to configure the LowPower feature of Azure RTOS ThreadX stack. In addition, it shows how to use ThreadX MACRO related to the LowPower feature. readme
ThreadX Tx_MPU It demonstrates how to load, start and unload modules. In addition, it shows how ThreadX memory protection on modules using the Memory Protection Unit (MPU). readme
USBX Ux_Host_MSC It demonstrates how to develop USB Host Mass Storage "MSC" able to enumerate and communicates with a removable usb flash disk. The application is designed to behave as an USB MSC Host able to operate with an USB flash disk using the Bulk Only Transfer (BOT) and Small Computer System Interface (SCSI) transparent commands combined with a file system AzureRTOS FileX. readme
USBX Ux_Host_HID It demonstrates how to develop USB Host Human Interface "HID" able to enumerate and communicates with a mouse or a keyboard. The application is designed to behave as an USB HID Host, the code provides required requests to properly enumerate HID devices , HID Class APIs to decode HID reports received from a mouse or a keyboard and display data on uart HyperTerminal. readme
USBX Ux_Host_CDC_ACM It demonstrates how to develop USB Host CDC ACM device able to properly enumerate CDC devices then send and receive data that can be displayed on Hyperterminal or alike. readme
USBX Ux_Device_MSC It demonstrates how to develop USB Device mass storage class based application. The application is designed to emulate an USB MSC device, the code provides all required device descriptors framework and the associated Class descriptor report to build a compliant USB MSC device readme
USBX Ux_Device_CDC_ACM It demonstrates how to develop USB Device communication Class "CDC_ACM" based application. The application is designed to emulate an USB-to-UART bridge following the Virtual COM Port (VCP) implementation, the code provides all required device descriptors framework and associated Class descriptor report to build a compliant USB CDC_ACM device. readme.
USBX Ux_Device_HID It demonstrates how to develop USB Device Human Interface "HID" mouse based application. The application is designed to emulate an USB HID mouse device, the code provides all required device descriptors framework and associated Class descriptor report to build a compliant USB HID mouse device. readme
USBX Ux_Device_CDC_ECM It demonstrates how to develop USB Device CDC ECM communication. It shows how to run Web HTTP server based application stack over USB interface using USB CDC ECM protocol. readme
USBX Ux_Host_DualClass It demonstrates how to develop USB Host supporting two device classes: USB_HID (mouse or keyboard) and USB_MSC (removable flash disk). readme
USBX Ux_Host_HID_CDC_ACM It demonstrates how to develop a composite "USB HID CDC_ACM Host" that is able to enumerate and communicate with composite USB HID CDC_ACM and simple HID/CDC_ACM devices. readme
USBX Ux_Device_HID_CDC_ACM It demonstrates how to develop a composite USB Device application. The application is designed to emulate a USB HID mouse combined with an USB-to-UART bridge following the Virtual COM Port (VCP) implementation, the code provides all required device descriptors framework and associated Class descriptor report to build a compliant composite USB HID and CDC_ACM device. readme.
USBX Ux_Device_DFU It demonstrates how to develop USB Device Firmware Upgrade "DFU" based application.The application is designed to emulate an USB DFU device, the code provides all required device descriptors framework and associated Class descriptor report to build a compliant USB DFU device. readme
FileX Fx_uSD_File_Edit It demonstrates how to develop a basic SD card file operations application. The application is designed to handle SD card insertion/removal events, and depending on that state, it starts and stops file operations from and into the SD card. readme
FileX Fx_MultiAccess It demonstrates the FileX's concurrent file access capabilities. The application is designed to execute file operations on the SD card device, the code provides all required software code for handling SD card I/O operations. readme
FileX Fx_NoR_Write_Read_File It demonstrates how to create a Fat File system on the NOR flash using FileX alongside LevelX. The application is designed to execute file operations on the MX25LM51245G NOR flash device, the code provides all required software code for properly managing it. readme
FileX Fx_DualInstance It demonstrates the coexistence capability of two FileX/Levelx stacks running independently on each core. readme
FileX Fx_IAP It demonstrates how to implement an In-Application programming (IAP) using FileX's SD file access capabilities. The application is designed to erase and write to on-chip flash memory, it provides all required software code for handling SD card and flash memory I/O operations. This is a typical application on how to use the SD card peripheral for firmware upgrade application or IAP, allowing user to erase and write to on-chip flash memory. readme
FileX Fx_SRAM_File_Edit_Standalone It demonstrates how to create a Fat File system on the internal SRAM memory using FileX running in standalone mode without ThreadX. readme
NetXDuo Nx_TCP_Echo_Server It demonstrates how to develop a NetX TCP server to communicate with a remote client using the NetX TCP socket API. readme
NetXDuo Nx_TCP_Echo_Client It demonstrates how to develop a NetX TCP client to communicate with a remote sever using the NetX TCP socket API. readme
NetXDuo Nx_UDP_Echo_Server It demonstrates how to develop a NetX UDP server to communicate with a remote client using the NetX UDP socket API. readme
NetXDuo Nx_UDP_Echo_Client It demonstrates how to develop a NetX UDP client to communicate with a remote sever using the NetX UDP socket API. readme
NetXDuo Nx_WebServer It demonstrates how to develop Web HTTP server based application.It is designed to load files and static web pages stored in SD card using a Web HTTP server, the code provides all required features to build a compliant Web HTTP Server. readme
NetXDuo Nx_MQTT_Client It demonstrates how to exchange data between client and server using MQTT protocol in an encrypted mode supporting TLS v1.2. readme
NetXDuo Nx_SNTP_Client It demonstrates how to develop a NetX SNTP client and connect with an STNP server to get a time update. readme

Troubleshooting

Caution : The issues are strictly limited to submit problems or suggestions related to the software delivered in this repository.

For any other question related to the product, the hardware performance or characteristics, the tools, the environment, you can submit it to the ST Community on the STM32 MCUs related page.

x-cube-azrtos-f4's People

Contributors

aselstm avatar rkoustm avatar stmicroelectronics-github avatar tounstm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

x-cube-azrtos-f4's Issues

MemInit() fails when using cmsis_os2 abstraction layer

Caution

The Issues are strictly limited for the reporting of problem encountered with the software provided in this project.
For any other problem related to the STM32 product, the performance, the hardware characteristics and boards, the tools the environment in general, please post your report to the ST Community in the STM32 MCUs dedicated page.

Describe the set-up

  • The board (either ST RPN reference or your custom board)
  • IDE or at least the compiler and its version

Describe the bug (skip if none)

A clear and concise description of what the bug is.

How to reproduce the bug (skip if none)

  1. Indicate the global behavior of your application project
  2. List the modules that you suspect to be the cause of the problem (Drivers, BSP, MW...)
  3. Describe the use case that generates the problem
  4. How we can reproduce the problem

Additional context

If you have a first analysis, an enhancement, a fix or a patch, thank you to share your proposal.

Screenshots

If applicable, add screenshots to help explain your problem.

STM32CubeIDE version 1.8.0
STM32CubeMX version 6.4.0
Board -> NUCLEO-F429ZI (Nucleo 144)

I am porting X-cube-cellular version 7.0.0 to the STM32F4 platform. My code compiles and runs but the call to MemInit () in osKernelIntialize() fails when it calls tx_byte_pool_create().

I created my project using CubeMX and set it up for Azure RTOS F4 Software package. I have kept the NetX and TX defines the same as the X-Cube-cellular project (B-L462E-CELL1->Nx_TCP_Echo_Client_PPP). I have attached my complete project below. I'm sure this has something do with CubeMX configuration and using the abstraction layer but I have no idea where to start debugging. Any help is very appreciated! Thanks

Cellular2_AzRTOS_F429.zip

Why ux_slave_class_name of ux_slave_interface_next_interface is NULL?

Describe the set-up

I try to migrate USBX CDC ACM to STM32F407ZGT6. Now USB Device can be recognized by Computer as STM32 USB Device.

image

But I can't read any data from PC host. And I found ux_utility_memory_compare is not right.

  /* Compares two memory blocks ux_slave_class_name and _ux_system_slave_class_cdc_acm_name */
  ux_status = ux_utility_memory_compare(data_interface->ux_slave_interface_class->ux_slave_class_name,
                                        _ux_system_slave_class_cdc_acm_name,
                                        ux_utility_string_length_get(_ux_system_slave_class_cdc_acm_name));

ux_status is always return 255. data_interface->ux_slave_interface_class is NULL.
image

The full read code is like:

void usbx_cdc_acm_read_thread_entry(ULONG arg)
{
  UX_SLAVE_DEVICE *device;
  UX_SLAVE_INTERFACE *data_interface;
  UX_SLAVE_CLASS_CDC_ACM *cdc_acm;
  ULONG actual_length;
  ULONG ux_status = UX_SUCCESS;
  ULONG senddataflag = 0;

  /* Get device */
  device = &_ux_system_slave->ux_system_slave_device;

  while (1)
    {

      /* Check if device is configured */
      if (device->ux_slave_device_state == UX_DEVICE_CONFIGURED)
        {
          /* Get Data interface */
          data_interface = device->ux_slave_device_first_interface->ux_slave_interface_next_interface;

          /* Compares two memory blocks ux_slave_class_name and _ux_system_slave_class_cdc_acm_name */
          ux_status = ux_utility_memory_compare(data_interface->ux_slave_interface_class->ux_slave_class_name,
                                                _ux_system_slave_class_cdc_acm_name,
                                                ux_utility_string_length_get(_ux_system_slave_class_cdc_acm_name));

          /* Check Compares success */
           if (ux_status == UX_SUCCESS)
            {
              cdc_acm =  data_interface->ux_slave_interface_class_instance;

              /* Set transmission_status to UX_FALSE for the first time */
              cdc_acm -> ux_slave_class_cdc_acm_transmission_status = UX_FALSE;

              /* Read the received data in blocking mode */
              ux_device_class_cdc_acm_read(cdc_acm, (UCHAR *)UserRxBufferFS, 3,
                                           &actual_length);
              if (actual_length != 0)
                {
                  /* Send the data via UART */
//                  if (HAL_UART_Transmit_DMA(&huart3, (uint8_t *)UserRxBufferFS,
//                                            actual_length) != HAL_OK)
//                    {
//                      /* Transfer error in reception process */
//                      Error_Handler();
//                    }

                  /* Wait until the requested flag TX_NEW_TRANSMITTED_DATA is received */
                  if (tx_event_flags_get(&EventFlag, TX_NEW_TRANSMITTED_DATA, TX_OR_CLEAR,
                                         &senddataflag, TX_WAIT_FOREVER) != TX_SUCCESS)
                    {
                      Error_Handler();
                    }
                }
            }
        }
      else
        {
          tx_thread_sleep(1);
        }
    }
}

STM32CUBEMX 6.6.1
Firmware FW_F4_V1.27.0

Question
Are there any reasons for "next interface.ux_slave_class_name is NULL"? I can't find any error in my code. Because USB device has been configured correctly. ux_app_parameters_change(VOID *cdc_acm) is also called when connected.

Screenshots

image

Here is my cubemx screenshots.
image

Where is best place to call LAN8742_StartAutoNego()?

I have a custom stm32f407igt6 board with LAN8742A eth interface.

I got a problem that i can get eth work in 10MBITS_HALFDUPLEX mode only.
I have checked nx_stm32_phy_driver.c and nx_stm32_eth_driver.c,
there are no LAN8742_StartAutoNego() calling.

After add following modification, It's work fine.

int32_t nx_eth_phy_init(void)
{
    int32_t ret = ETH_PHY_STATUS_ERROR;
    /* Set PHY IO functions */

    LAN8742_RegisterBusIO(&LAN8742, &LAN8742_IOCtx);
    /* Initialize the LAN8742 ETH PHY */

    if (LAN8742_Init(&LAN8742) == LAN8742_STATUS_OK)
    {
      printf("LAN8742 Inital OK\n");
      ret = ETH_PHY_STATUS_OK;
    }else{
      printf("LAN8742 Fail\n");
      ret = ETH_PHY_STATUS_ERROR;
    }

    if (LAN8742_StartAutoNego(&LAN8742) == LAN8742_STATUS_OK)
    {
      ret = ETH_PHY_STATUS_OK;
    }else{
      ret = ETH_PHY_STATUS_ERROR;
    }

    do{
      //wait AUTONEGO done
    }while(LAN8742_STATUS_AUTONEGO_NOTDONE == LAN8742_GetLinkState(&LAN8742));

    do{
      //wait link state go up
    }while(LAN8742_STATUS_LINK_DOWN == LAN8742_GetLinkState(&LAN8742));
    
    return ret;
}

but after update souce code with stm32cubemx , it will be replaced.

please help work it around.

USB Host Msc 这个例程中插拔U盘的中断有问题,刚开始可以正常识别,过一会就不能产生任何事件了

Caution

The Issues are strictly limited for the reporting of problem encountered with the software provided in this project.
For any other problem related to the STM32 product, the performance, the hardware characteristics and boards, the tools the environment in general, please post your report to the ST Community in the STM32 MCUs dedicated page.

Describe the set-up

  • The board (either ST RPN reference or your custom board)
  • IDE or at least the compiler and its version

Describe the bug (skip if none)

A clear and concise description of what the bug is.

How to reproduce the bug (skip if none)

  1. Indicate the global behavior of your application project
  2. List the modules that you suspect to be the cause of the problem (Drivers, BSP, MW...)
  3. Describe the use case that generates the problem
  4. How we can reproduce the problem

Additional context

If you have a first analysis, an enhancement, a fix or a patch, thank you to share your proposal.

Screenshots

If applicable, add screenshots to help explain your problem.

"fx_stm32_custom_driver_c.ftl" change word

Development Environment :
STM32CubeIDE Version: 1.13.1
X-CUBE-AZRTOS-F4 V1.1.0

Issue : LevelX NOR Custom interface Code Generation problem
File : STM32CubeMX\templates\fx_stm32_custom_driver_c.ftl

static UINT lx_nor_driver_read(ULONG *flash_address, ULONG *destination, ULONG words)
{
UINT ret = LX_SUCCESS;

/* USER CODE BEGIN NOR_READ */

/* USER CODE END  NOR_READ */

return ret;

}

static UINT lx_nor_driver_write(ULONG *flash_address, ULONG *source, ULONG words)
{
UINT ret = LX_SUCCESS;

/* USER CODE BEGIN NOR_WRITE */ <====

/* USER CODE END  NOR_WRITE */ <====

return ret;

}

static UINT lx_nor_driver_block_erase(ULONG block, ULONG erase_count)
{

UINT ret = LX_SUCCESS;

/* USER CODE BEGIN NOR_WRITE */  <==== same word "NOR_WRITE"

/* USER CODE END  NOR_WRITE */  <==== same word "NOR_WRITE"

return ret;

}

static UINT lx_nor_driver_block_erased_verify(ULONG block)
{
UINT ret = LX_SUCCESS;

/* USER CODE BEGIN NOR_WRITE */ <==== same word "NOR_WRITE"

/* USER CODE END  NOR_WRITE */ <==== same word "NOR_WRITE"

return ret;

}

need change code :

static UINT lx_nor_driver_block_erase(ULONG block, ULONG erase_count)
{

UINT ret = LX_SUCCESS;

/* USER CODE BEGIN NOR_BLOCK_ERASE */

/* USER CODE END  NOR_BLOCK_ERASE */

return ret;

}

static UINT lx_nor_driver_block_erased_verify(ULONG block)
{
UINT ret = LX_SUCCESS;

/* USER CODE BEGIN NOR_BLOCK_ERASED_VERUFY */

/* USER CODE END  NOR_BLOCK_ERASED_VERUFY */

return ret;

}

netxduo dhcp+autoip+mdns instability

Caution

The Issues are strictly limited for the reporting of problem encountered with the software provided in this project.
For any other problem related to the STM32 product, the performance, the hardware characteristics and boards, the tools the environment in general, please post your report to the ST Community in the STM32 MCUs dedicated page.

Describe the set-up

  • The board (either ST RPN reference or your custom board)
  • IDE or at least the compiler and its version

Describe the bug (skip if none)

A clear and concise description of what the bug is.

How to reproduce the bug (skip if none)

  1. Indicate the global behavior of your application project
  2. List the modules that you suspect to be the cause of the problem (Drivers, BSP, MW...)
  3. Describe the use case that generates the problem
  4. How we can reproduce the problem

Additional context

If you have a first analysis, an enhancement, a fix or a patch, thank you to share your proposal.

Screenshots

If applicable, add screenshots to help explain your problem.

USBX CDC ACM There is a problem with ux_device_class_cdc_acm_write

I ported ThreadX and USBX on STM32F105RBT6. The USBX HID works well. When I try to use USBX CDC, the problem arises. I am using
The USBX sample app of x-cube-azrtos-f4. When I use the USB virtual serial port to send data to the serial port 3, everything is normal. When I use the serial port 3 to receive data and send it to the USB virtual serial port, the problem occurs. When the data exceeds a certain amount, HAL_UART_RxCpltCallback () It can still trigger and receive data from the serial port, but ux_device_class_cdc_acm_write does not work properly. Why?

version conflict

Hi,
version 6.5 does not support x-cube f4 v1.0
how to solve this issue ?
V1.1 of x-cube is there , is it comatible with versions of cubemx above 6.4 ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.