Ignore:
Timestamp:
Jan 23, 2025, 4:10:33 PM (4 days ago)
Author:
Zed
Message:

NetX can be compiled and initialized.

Location:
ctrl/firmware/Main/CubeMX
Files:
73 added
5 edited

Legend:

Unmodified
Added
Removed
  • ctrl/firmware/Main/CubeMX/AZURE_RTOS/App/app_azure_rtos.c

    r54 r69  
    6262static TX_BYTE_POOL fx_app_byte_pool;
    6363
     64/* USER CODE BEGIN NX_Pool_Buffer */
     65/* USER CODE END NX_Pool_Buffer */
     66#if defined ( __ICCARM__ )
     67#pragma data_alignment=4
     68#endif
     69__ALIGN_BEGIN static UCHAR nx_byte_pool_buffer[NX_APP_MEM_POOL_SIZE] __ALIGN_END;
     70static TX_BYTE_POOL nx_app_byte_pool;
     71
    6472#endif
    6573
     
    142150
    143151    /* USER CODE END MX_FileX_Init_Success */
     152  }
     153
     154  if (tx_byte_pool_create(&nx_app_byte_pool, "Nx App memory pool", nx_byte_pool_buffer, NX_APP_MEM_POOL_SIZE) != TX_SUCCESS)
     155  {
     156    /* USER CODE BEGIN NX_Byte_Pool_Error */
     157
     158    /* USER CODE END NX_Byte_Pool_Error */
     159  }
     160  else
     161  {
     162    /* USER CODE BEGIN NX_Byte_Pool_Success */
     163
     164    /* USER CODE END NX_Byte_Pool_Success */
     165
     166    memory_ptr = (VOID *)&nx_app_byte_pool;
     167    status = MX_NetXDuo_Init(memory_ptr);
     168    if (status != NX_SUCCESS)
     169    {
     170      /* USER CODE BEGIN  MX_NetXDuo_Init_Error */
     171      while(1)
     172      {
     173      }
     174      /* USER CODE END  MX_NetXDuo_Init_Error */
     175    }
     176
     177    /* USER CODE BEGIN MX_NetXDuo_Init_Success */
     178
     179    /* USER CODE END MX_NetXDuo_Init_Success */
     180
    144181  }
    145182
  • ctrl/firmware/Main/CubeMX/AZURE_RTOS/App/app_azure_rtos.h

    r57 r69  
    3232
    3333#include "app_filex.h"
     34
     35#include "app_netxduo.h"
    3436/* Private includes ----------------------------------------------------------*/
    3537/* USER CODE BEGIN Includes */
  • ctrl/firmware/Main/CubeMX/AZURE_RTOS/App/app_azure_rtos_config.h

    r57 r69  
    4848#define FX_APP_MEM_POOL_SIZE                     8192
    4949
     50#define NX_APP_MEM_POOL_SIZE                     12288
     51
    5052/* USER CODE BEGIN EC */
    5153
  • ctrl/firmware/Main/CubeMX/Core/Src/app_threadx.c

    r66 r69  
    3434#include "gsm_rx_thread.h"
    3535#include "fan_thread.h"
     36#include "eth_thread.h"
    3637
    3738/* USER CODE END Includes */
     
    4950#define GSM_RX_THREAD_STACK_SIZE_BYTES          (1024U)
    5051#define FAN_THREAD_STACK_SIZE_BYTES                     (512U)
     52#define ETH_THREAD_STACK_SIZE_BYTES                     (2048U)
    5153
    5254/* USER CODE END PD */
     
    6062/* USER CODE BEGIN PV */
    6163
    62 TX_THREAD scan_keys_thread_ptr;
    63 TX_THREAD gsm_thread_ptr;
    64 TX_THREAD gsm_rx_thread_ptr;
    65 TX_THREAD fan_thread_ptr;
     64TX_THREAD scan_keys_thread;
     65TX_THREAD gsm_thread;
     66TX_THREAD gsm_rx_thread;
     67TX_THREAD fan_thread;
     68TX_THREAD eth_thread;
    6669
    6770/* USER CODE END PV */
     
    8790  VOID *gsm_rx_thread_pointer;
    8891  VOID *fan_thread_pointer;
     92  VOID *eth_thread_pointer;
    8993
    9094  /* USER CODE END App_ThreadX_MEM_POOL */
     
    97101
    98102  char* scan_keys_thread_name = "Scan Keys Thread";
    99   ret = tx_thread_create(&scan_keys_thread_ptr, scan_keys_thread_name, scanKeysThread, 0x0001, keys_thread_pointer, KEYS_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START);
     103  ret = tx_thread_create(&scan_keys_thread, scan_keys_thread_name, scanKeysThread, 0x0001, keys_thread_pointer, KEYS_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START);
    100104  if (ret != TX_SUCCESS) { printf("Cannot create %s!\n", scan_keys_thread_name); return ret; }
    101105
     
    106110
    107111  char* gsm_thread_name = "GSM Thread";
    108   ret = tx_thread_create(&gsm_thread_ptr, gsm_thread_name, gsmThread, 0x0001,   gsm_thread_pointer, GSM_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START);
     112  ret = tx_thread_create(&gsm_thread, gsm_thread_name, gsmThread, 0x0001,       gsm_thread_pointer, GSM_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START);
    109113  if (ret != TX_SUCCESS) { printf("Cannot create %s!\n", gsm_thread_name); return ret; }
    110114
     
    114118
    115119  char* gsm_rx_thread_name = "GSM RX Thread";
    116   ret = tx_thread_create(&gsm_rx_thread_ptr, gsm_rx_thread_name, gsmRxThread, 0x0001, gsm_rx_thread_pointer, GSM_RX_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START);
     120  ret = tx_thread_create(&gsm_rx_thread, gsm_rx_thread_name, gsmRxThread, 0x0001, gsm_rx_thread_pointer, GSM_RX_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START);
    117121  if (ret != TX_SUCCESS) { printf("Cannot create %s!\n", gsm_rx_thread_name); return ret; }
    118122
     
    122126
    123127  char* fan_thread_name = "FAN Thread";
    124   ret = tx_thread_create(&fan_thread_ptr, fan_thread_name, fanThread, 0x0001, fan_thread_pointer, FAN_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START);
     128  ret = tx_thread_create(&fan_thread, fan_thread_name, fanThread, 0x0001, fan_thread_pointer, FAN_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START);
     129  if (ret != TX_SUCCESS) { printf("Cannot create %s!\n", fan_thread_name); return ret; }
     130
     131  // Allocate the stack for ethernet thread
     132  ret = tx_byte_allocate(byte_pool, &eth_thread_pointer, ETH_THREAD_STACK_SIZE_BYTES, TX_NO_WAIT);
     133  if (ret != TX_SUCCESS) { printf("Cannot allocate bytes of memory!\n"); return ret; }
     134
     135  char* eth_thread_name = "ETH Thread";
     136  ret = tx_thread_create(&eth_thread, eth_thread_name, ethThread, 0x0001, eth_thread_pointer, ETH_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START);
    125137  if (ret != TX_SUCCESS) { printf("Cannot create %s!\n", fan_thread_name); return ret; }
    126138
  • ctrl/firmware/Main/CubeMX/charger.ioc

    r66 r69  
    131131Mcu.Pin45=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjFileX_6.4.0_3.3.0
    132132Mcu.Pin46=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0
     133Mcu.Pin47=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_NetworkJjNetXDuo_6.4.0_3.3.0
    133134Mcu.Pin5=PF15
    134135Mcu.Pin6=PG0
     
    136137Mcu.Pin8=PE7
    137138Mcu.Pin9=PE11
    138 Mcu.PinsNb=47
     139Mcu.PinsNb=48
    139140Mcu.ThirdParty0=STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0
    140141Mcu.ThirdPartyNb=1
     
    435436STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FileOoSystemJjInterfaces_Checked=true
    436437STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FileXCcFileOoSystemJjFileXJjCore=true
    437 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.IPParameters=TX_APP_MEM_POOL_SIZE,FX_APP_MEM_POOL_SIZE,TX_APP_GENERATE_INIT_CODE,TX_APP_CREATION,TX_ENABLE_STACK_CHECKING,TX_NO_FILEX_POINTER,TX_LOW_POWER,FX_ENABLE_EXFAT,FX_ENABLE_FAULT_TOLERANT,FX_FAULT_TOLERANT,FX_FAULT_TOLERANT_DATA,FX_DRIVER_SD_INIT,TX_TIMER_TICKS_PER_SECOND,TX_APP_MSG_QUEUE_CREATION,TX_MSG_QUEUE_NAME,TX_NB_MSG,ThreadXCcRTOSJjThreadXJjCore,ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport,FileXCcFileOoSystemJjFileXJjCore,InterfacesCcFileOoSystemJjFileXOoSDOointerface
     438STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.IPParameters=TX_APP_MEM_POOL_SIZE,FX_APP_MEM_POOL_SIZE,TX_APP_GENERATE_INIT_CODE,TX_APP_CREATION,TX_ENABLE_STACK_CHECKING,TX_NO_FILEX_POINTER,TX_LOW_POWER,FX_ENABLE_EXFAT,FX_ENABLE_FAULT_TOLERANT,FX_FAULT_TOLERANT,FX_FAULT_TOLERANT_DATA,FX_DRIVER_SD_INIT,TX_TIMER_TICKS_PER_SECOND,TX_APP_MSG_QUEUE_CREATION,TX_MSG_QUEUE_NAME,TX_NB_MSG,ThreadXCcRTOSJjThreadXJjCore,ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport,FileXCcFileOoSystemJjFileXJjCore,InterfacesCcFileOoSystemJjFileXOoSDOointerface,NetXDuoCcNetworkJjNetXDuoJjNXOoCore
    438439STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.InterfacesCcFileOoSystemJjFileXOoSDOointerface=true
     440STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.NetXDuoCcNetworkJjNetXDuoJjNXOoCore=true
     441STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.NetworkJjInterfaces_Checked=false
     442STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.NetworkJjNetXDuo_Checked=true
    439443STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.RTOSJjThreadX_Checked=true
    440444STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_CREATION=0
     
    451455STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport=true
    452456STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0_IsAnAzureRtosMw=true
    453 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0_SwParameter=InterfacesCcFileOoSystemJjFileXOoSDOointerface\:true;ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport\:true;FileXCcFileOoSystemJjFileXJjCore\:true;ThreadXCcRTOSJjThreadXJjCore\:true;
     457STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0_SwParameter=InterfacesCcFileOoSystemJjFileXOoSDOointerface\:true;ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport\:true;NetXDuoCcNetworkJjNetXDuoJjNXOoCore\:true;InterfacesCcNetworkJjCustomOoInterface\:true;FileXCcFileOoSystemJjFileXJjCore\:true;ThreadXCcRTOSJjThreadXJjCore\:true;
    454458TIM3.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
    455459TIM3.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
     
    477481VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0.Mode=FileOoSystemJjInterfaces
    478482VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0.Signal=STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0
     483VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_NetworkJjNetXDuo_6.4.0_3.3.0.Mode=NetworkJjNetXDuo
     484VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_NetworkJjNetXDuo_6.4.0_3.3.0.Signal=STMicroelectronics.X-CUBE-AZRTOS-H7_VS_NetworkJjNetXDuo_6.4.0_3.3.0
    479485VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0.Mode=RTOSJjThreadX
    480486VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0.Signal=STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0
Note: See TracChangeset for help on using the changeset viewer.