Skip to content

Commit

Permalink
Relocate ESP32 target to ESP32_WROOM_32 (#1184)
Browse files Browse the repository at this point in the history
  • Loading branch information
josesimoes committed Jan 31, 2019
1 parent c7efead commit 24e1acf
Show file tree
Hide file tree
Showing 126 changed files with 45 additions and 504 deletions.
8 changes: 4 additions & 4 deletions .vscode/launch.TEMPLATE-ESP32.json
Expand Up @@ -8,12 +8,12 @@
"MIMode": "gdb",
"miDebuggerPath": "<absolute-path-to-the-toolchain-folder-mind-the-forward-slashes>/bin/xtensa-esp32-elf-gdb.exe",
"stopAtEntry":true,
"program": "<absolute-path-to-the-build-folder-mind-the-forward-slashes>/targets/FreeRTOS/ESP32_DevKitC/nanoCLR.elf",
"program": "<absolute-path-to-the-build-folder-mind-the-forward-slashes>/targets/FreeRTOS_ESP32/ESP32_WROOM_32/nanoCLR.elf",

"setupCommands": [
{"text": "set logging on"},
{"text": "target extended-remote localhost:3333"},
{"text": "file <absolute-path-to-the-build-folder-mind-the-forward-slashes>/targets/FreeRTOS/ESP32_DevKitC/nanoCLR.elf"},
{"text": "file <absolute-path-to-the-build-folder-mind-the-forward-slashes>/targets/FreeRTOS_ESP32/ESP32_WROOM_32/nanoCLR.elf"},
{"text": "monitor reset halt"},
{"text": "thb app_main"},
{"text": "x $a1=0"}
Expand Down Expand Up @@ -43,12 +43,12 @@
"MIMode": "gdb",
"miDebuggerPath": "<absolute-path-to-the-toolchain-folder-mind-the-forward-slashes>/bin/xtensa-esp32-elf-gdb.exe",
"stopAtEntry":true,
"program": "<absolute-path-to-the-build-folder-mind-the-forward-slashes>/targets/FreeRTOS/ESP32_DevKitC/nanoCLR.elf",
"program": "<absolute-path-to-the-build-folder-mind-the-forward-slashes>/targets/FreeRTOS_ESP32/ESP32_WROOM_32/nanoCLR.elf",

"setupCommands": [
{"text": "set logging on"},
{"text": "target extended-remote localhost:3333"},
{"text": "file <absolute-path-to-the-build-folder-mind-the-forward-slashes>/targets/FreeRTOS/ESP32_DevKitC/nanoCLR.elf"},
{"text": "file <absolute-path-to-the-build-folder-mind-the-forward-slashes>/targets/FreeRTOS_ESP32/ESP32_WROOM_32/nanoCLR.elf"},
{"text": "monitor reset halt"},
{"text": "thb app_main"},
{"text": "x $a1=0"}
Expand Down
24 changes: 12 additions & 12 deletions CMakeLists.txt
Expand Up @@ -53,7 +53,7 @@ endif()
# list of supported RTOSes
# when adding a new RTOS add the corresponding string bellow AND...
# ... also on the compare block bellow
set(RTOS_SUPPORTED "CHIBIOS" "FREERTOS" CACHE INTERNAL "supported RTOS options")
set(RTOS_SUPPORTED "CHIBIOS" "FREERTOS_ESP32" CACHE INTERNAL "supported RTOS options")

list(FIND RTOS_SUPPORTED ${RTOS} RTOS_INDEX)
if(RTOS_INDEX EQUAL -1)
Expand All @@ -63,18 +63,18 @@ else()
endif()

string(COMPARE EQUAL "CHIBIOS" "${RTOS}" RTOS_CHIBIOS_CHECK)
string(COMPARE EQUAL "FREERTOS" "${RTOS}" RTOS_FREERTOS_CHECK)
string(COMPARE EQUAL "FREERTOS_ESP32" "${RTOS}" RTOS_FREERTOS_ESP32_CHECK)

##########################################################################

if(RTOS_FREERTOS_CHECK)
set(RTOS_FREERTOS_CHECK TRUE)
if(RTOS_FREERTOS_ESP32_CHECK)
set(RTOS_FREERTOS_ESP32_CHECK TRUE)
set(RTOS_CHIBIOS_CHECK FALSE)
endif()

if(RTOS_CHIBIOS_CHECK)
set(RTOS_CHIBIOS_CHECK TRUE)
set(RTOS_FREERTOS_CHECK FALSE)
set(RTOS_FREERTOS_ESP32_CHECK FALSE)
endif()

#######################
Expand All @@ -101,7 +101,7 @@ if(RTOS_CHIBIOS_CHECK)
# set toolchain file
set(CMAKE_TOOLCHAIN_FILE CMake/toolchain.ChibiOS.${TOOLCHAIN}.cmake)

elseif(RTOS_FREERTOS_CHECK)
elseif(RTOS_FREERTOS_ESP32_CHECK)
message(STATUS "\nSetting Toolchain file for FreeRTOS ESP32 \n")
set(CMAKE_TOOLCHAIN_FILE CMake/toolchain.FreeRtos.ESP32.${TOOLCHAIN}.cmake)

Expand Down Expand Up @@ -1009,11 +1009,11 @@ if(RTOS_CHIBIOS_CHECK)
endif()

#######################
# FreeRTOS
elseif(RTOS_FREERTOS_CHECK)
# FreeRTOS_ESP32
elseif(RTOS_FREERTOS_ESP32_CHECK)

if("${TARGET_SERIES}" STREQUAL "ESP32")
message(STATUS "Platform ESP32")
message(STATUS "Platform ESP32 target board: ${ESP32_BOARD}")

# check watchdog feature
# EPS32 build has watchdog enabled by default, so setting it to OFF doens't make sense
Expand All @@ -1023,12 +1023,12 @@ elseif(RTOS_FREERTOS_CHECK)
endif()

# Define base path for the class libraries
set(BASE_PATH_FOR_CLASS_LIBRARIES_MODULES "${PROJECT_SOURCE_DIR}/targets/FreeRTOS/ESP32_DevKitC/nanoCLR")
set(BASE_PATH_FOR_CLASS_LIBRARIES_MODULES "${PROJECT_SOURCE_DIR}/targets/FreeRTOS_ESP32/${ESP32_BOARD}/nanoCLR")

# set target base location
set(TARGET_BASE_LOCATION "${PROJECT_SOURCE_DIR}/targets/FreeRTOS/ESP32_DevKitC")
set(TARGET_BASE_LOCATION "${PROJECT_SOURCE_DIR}/targets/FreeRTOS_ESP32/${ESP32_BOARD}")
add_subdirectory(targets/FreeRTOS_ESP32/${ESP32_BOARD})

add_subdirectory(targets/FreeRTOS/ESP32_DevKitC)
endif()

endif()
2 changes: 1 addition & 1 deletion CMakeSettings.json
Expand Up @@ -281,7 +281,7 @@
},
{
"name": "RTOS", //"Selected Operating system
"value": "FREERTOS"
"value": "FREERTOS_ESP32"
},
{
"name": "SWO_OUTPUT_OPTION", // Single Wire Output Option
Expand Down
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -29,7 +29,7 @@ This repo contains:
* [STM32 Flexible Memory Controller driver](targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_fsmc)
* [STM32 Random number generator driver](targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/stm32_rng)
* Target reference for FreeRTOS
* [ESP32_DevKitC](targets/FreeRTOS/ESP32_DevKitC)
* [ESP32_WROOM_32](targets/FreeRTOS_ESP32/ESP32_WROOM_32)
* Target reference for other OSes
* [Win32 OS (test project only at this time)](targets/os/win32)
* [CMake files for the build system](CMake)
Expand Down Expand Up @@ -60,7 +60,7 @@ The **preview** versions are continuous builds of the reference targets. They in
| ST_STM32F769I_DISCOVERY | [ ![Download](https://api.bintray.com/packages/nfbot/nanoframework-images/ST_STM32F769I_DISCOVERY/images/download.svg) ](https://bintray.com/nfbot/nanoframework-images/ST_STM32F769I_DISCOVERY/_latestVersion) | [ ![Download](https://api.bintray.com/packages/nfbot/nanoframework-images-dev/ST_STM32F769I_DISCOVERY/images/download.svg) ](https://bintray.com/nfbot/nanoframework-images-dev/ST_STM32F769I_DISCOVERY/_latestVersion) |
| MBN_QUAIL | [ ![Download](https://api.bintray.com/packages/nfbot/nanoframework-images/MBN_QUAIL/images/download.svg) ](https://bintray.com/nfbot/nanoframework-images/MBN_QUAIL/_latestVersion) | [ ![Download](https://api.bintray.com/packages/nfbot/nanoframework-images-dev/MBN_QUAIL/images/download.svg) ](https://bintray.com/nfbot/nanoframework-images-dev/MBN_QUAIL/_latestVersion) |
| NETDUINO3_WIFI | [ ![Download](https://api.bintray.com/packages/nfbot/nanoframework-images/NETDUINO3_WIFI/images/download.svg) ](https://bintray.com/nfbot/nanoframework-images/NETDUINO3_WIFI/_latestVersion) | [ ![Download](https://api.bintray.com/packages/nfbot/nanoframework-images-dev/NETDUINO3_WIFI/images/download.svg) ](https://bintray.com/nfbot/nanoframework-images-dev/NETDUINO3_WIFI/_latestVersion) |
| ESP32_DEVKITC | [ ![Download](https://api.bintray.com/packages/nfbot/nanoframework-images/ESP32_DEVKITC/images/download.svg) ](https://bintray.com/nfbot/nanoframework-images/ESP32_DEVKITC/_latestVersion) | [ ![Download](https://api.bintray.com/packages/nfbot/nanoframework-images-dev/ESP32_DEVKITC/images/download.svg) ](https://bintray.com/nfbot/nanoframework-images-dev/ESP32_DEVKITC/_latestVersion) |
| ESP32_WROOM_32 | [ ![Download](https://api.bintray.com/packages/nfbot/nanoframework-images/ESP32_WROOM_32/images/download.svg) ](https://bintray.com/nfbot/nanoframework-images/ESP32_WROOM_32/_latestVersion) | [ ![Download](https://api.bintray.com/packages/nfbot/nanoframework-images-dev/ESP32_WROOM_32/images/download.svg) ](https://bintray.com/nfbot/nanoframework-images-dev/ESP32_WROOM_32/_latestVersion) |


The above firmware builds include support for the class libraries and features marked bellow.
Expand All @@ -73,7 +73,7 @@ The above firmware builds include support for the class libraries and features m
| ST_STM32F769I_DISCOVERY | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| MBN_QUAIL | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | |
| NETDUINO3_WIFI | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | |
| ESP32_DEVKITC | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: | | :heavy_check_mark: | |
| ESP32_WROOM_32 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: | | :heavy_check_mark: | |


## Feedback and documentation
Expand Down
8 changes: 4 additions & 4 deletions azure-pipelines-templates/build-esp32.yml
Expand Up @@ -7,7 +7,7 @@ parameters:
steps:
- task: CMake@1
inputs:
cmakeArgs: '-G Ninja -DTOOLCHAIN_PREFIX=$(ESP32_TOOLCHAIN_PATH) -DESP32_IDF_PATH=$(ESP32_IDF_PATH) -DESP32_LIBS_PATH=$(ESP32_LIBS_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_Version) $(BuildOptions) ..'
cmakeArgs: '-G Ninja -DTOOLCHAIN_PREFIX=$(ESP32_TOOLCHAIN_PATH) -DESP32_IDF_PATH=$(ESP32_IDF_PATH) -DESP32_LIBS_PATH=$(ESP32_LIBS_PATH) -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_VERSION=$(NBGV_Version) -DESP32_BOARD=$(BoardName) $(BuildOptions) ..'
workingDirectory: ${{ parameters.builDirectory }}
displayName: Setup build with CMake

Expand All @@ -21,7 +21,7 @@ steps:
inputs:
scriptSource: 'filePath'
scriptPath: '$(Agent.TempDirectory)\ESP32_Tools\esp-idf-v3.1\components\esptool_py\esptool\esptool.py'
arguments: '--chip esp32 elf2image --flash_mode dio --flash_freq 40m --flash_size 4MB -o ${{ parameters.builDirectory }}\nanoCLR.bin ${{ parameters.builDirectory }}\targets\FreeRTOS\ESP32_DevKitC\nanoCLR.elf'
arguments: '--chip esp32 elf2image --flash_mode dio --flash_freq 40m --flash_size 4MB -o ${{ parameters.builDirectory }}\nanoCLR.bin ${{ parameters.builDirectory }}\targets\FreeRTOS_ESP32\$(BoardName)\nanoCLR.elf'
condition: succeeded()
displayName: Generate nanoCLR bin file for deployment

Expand All @@ -31,15 +31,15 @@ steps:
inputs:
scriptSource: 'filePath'
scriptPath: '$(Agent.TempDirectory)\ESP32_Tools\esp-idf-v3.1\components\partition_table\gen_esp32part.py'
arguments: '--verify $(Build.SourcesDirectory)\targets\FreeRTOS\ESP32_DevKitC\IDF\partitions_nanoclr_4mb.csv ${{ parameters.builDirectory }}\partitions_4mb.bin'
arguments: '--verify $(Build.SourcesDirectory)\targets\FreeRTOS_ESP32\$(BoardName)\IDF\partitions_nanoclr_4mb.csv ${{ parameters.builDirectory }}\partitions_4mb.bin'
condition: succeeded()
displayName: Generate Esp32 Partition tables for 4MB flash

- task: PythonScript@0
inputs:
scriptSource: 'filePath'
scriptPath: '$(Agent.TempDirectory)\ESP32_Tools\esp-idf-v3.1\components\partition_table\gen_esp32part.py'
arguments: '--verify $(Build.SourcesDirectory)\targets\FreeRTOS\ESP32_DevKitC\IDF\partitions_nanoclr_2mb.csv ${{ parameters.builDirectory }}\partitions_2mb.bin'
arguments: '--verify $(Build.SourcesDirectory)\targets\FreeRTOS_ESP32\$(BoardName)\IDF\partitions_nanoclr_2mb.csv ${{ parameters.builDirectory }}\partitions_2mb.bin'
condition: succeeded()
displayName: Generate Esp32 Partition tables for 2MB flash

Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Expand Up @@ -131,9 +131,9 @@ jobs:
# there is only a single ESP32 target, but this is already config as a matrix to make it easy to add new ones
strategy:
matrix:
ESP32_DEVKITC:
BoardName: ESP32_DEVKITC
BuildOptions: -DTARGET_SERIES=ESP32 -DRTOS=FREERTOS -DNF_WP_IMPLEMENTS_CRC32=OFF -DNF_FEATURE_DEBUGGER=ON -DNF_FEATURE_RTC=ON -DNF_FEATURE_HAS_CONFIG_BLOCK=ON -DAPI_System.Math=ON -DAPI_Windows.Devices.Gpio=ON -DAPI_Windows.Devices.Spi=ON -DAPI_Windows.Devices.I2c=ON -DAPI_Windows.Devices.Pwm=ON -DAPI_Windows.Devices.SerialCommunication=ON -DAPI_Windows.Devices.Adc=ON -DAPI_System.Net=ON -DAPI_Windows.Devices.Wifi=ON -DNF_SECURITY_OPENSSL=ON -DAPI_Hardware.Esp32=ON -DSUPPORT_ANY_BASE_CONVERSION=ON
ESP32_WROOM_32:
BoardName: ESP32_WROOM_32
BuildOptions: -DTARGET_SERIES=ESP32 -DRTOS=FREERTOS_ESP32 -DNF_WP_IMPLEMENTS_CRC32=OFF -DNF_FEATURE_DEBUGGER=ON -DNF_FEATURE_RTC=ON -DNF_FEATURE_HAS_CONFIG_BLOCK=ON -DAPI_System.Math=ON -DAPI_Windows.Devices.Gpio=ON -DAPI_Windows.Devices.Spi=ON -DAPI_Windows.Devices.I2c=ON -DAPI_Windows.Devices.Pwm=ON -DAPI_Windows.Devices.SerialCommunication=ON -DAPI_Windows.Devices.Adc=ON -DAPI_System.Net=ON -DAPI_Windows.Devices.Wifi=ON -DNF_SECURITY_OPENSSL=ON -DAPI_Hardware.Esp32=ON -DSUPPORT_ANY_BASE_CONVERSION=ON

variables:
ESP32_TOOLCHAIN_PATH: $(Agent.TempDirectory)\ESP32_Tools
Expand Down
5 changes: 3 additions & 2 deletions cmake-variants.TEMPLATE-ESP32.json
Expand Up @@ -36,9 +36,10 @@
"TOOLCHAIN_PREFIX" : "<absolute-path-to-the-toolchain-prefix-folder-mind-the-forward-slashes>",
"ESP32_IDF_PATH" : "<absolute-path-to-the-IDF-folder-mind-the-forward-slashes>",
"ESP32_LIBS_PATH" : "<absolute-path-to-the-bootloader-folder-mind-the-forward-slashes>",
"TARGET_SERIES" : "ESP32",
"TARGET_SERIES" : "ESP32",
"ESP32_BOARD" : "ESP32_WROOM_32",
"USE_FPU" : "TRUE",
"RTOS" : "FREERTOS",
"RTOS" : "FREERTOS_ESP32",
"SWO_OUTPUT" : "OFF",
"NF_BUILD_RTM" : "OFF",
"NF_WP_TRACE_ERRORS" : "OFF",
Expand Down
2 changes: 1 addition & 1 deletion cmake-variants.TEMPLATE.json
Expand Up @@ -40,7 +40,7 @@
"USE_RNG" : "<ON-default-for-using-hardware-true-random-generator-unit>",
"DP_FLOATINGPOINT" : "<OFF-default-ON-for-adding-support-for-double-precision-floating-point>",
"SUPPORT_ANY_BASE_CONVERSION" : "<OFF-default-ON-for-adding-support-for-conversion-strings-to-values-on-any-base>",
"RTOS" : "<one-of-valid-rtos-options----CHIBIOS-FREERTOS>",
"RTOS" : "<one-of-valid-rtos-options----CHIBIOS-FREERTOS_ESP32>",
"CHIBIOS_SOURCE" : "<path-to-chibios-source-mind-the-forward-slash>",
"CHIBIOS_CONTRIB_REQUIRED" : "OFF-default-ON-to-include_ChibiOS-Contrib-repository-in-the-build",
"CHIBIOS_CONTRIB_SOURCE" : "<path-to-local-ChibiOS-contrib-source-mind-the-forward-slash>",
Expand Down
2 changes: 1 addition & 1 deletion install-scripts/install-esp32-tools.ps1
Expand Up @@ -7,7 +7,7 @@ param (

[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
Write-Host "Install Tools to build nanoCLR into default folders and configure json files ..."
$env:BOARD_NAME = "ESP32_DEVKITC"
$env:BOARD_NAME = "ESP32_WROOM_32"

If([string]::IsNullOrEmpty($COMPORT))
{
Expand Down

0 comments on commit 24e1acf

Please sign in to comment.