Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TI CC3220SF_LAUNCHXL #1297

Merged
merged 90 commits into from
May 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
7ca447f
Initial work on adding support for CC3200 Launchpad
josesimoes Jan 29, 2018
9594a67
Correct launch.json template for CC3200
josesimoes Jan 30, 2018
3153c87
Work on removing TI-RTOS and add support for CC3200 with ChibiOS
josesimoes Feb 9, 2018
da31df6
Add process of TI Simplelink SDK to main CMake
josesimoes Feb 6, 2019
ebe2eb3
Add skeleton for TI_CC3220SF_LAUNCHXL target
josesimoes Feb 6, 2019
1f36712
Further work with CC3220
josesimoes Feb 7, 2019
1d146fc
Work on TI_CC3220SF_LAUNCHXL
josesimoes Feb 8, 2019
fbd57f5
Remove unused CMake modules.
josesimoes Feb 8, 2019
f603eb9
Work on Receiver and CLR threads
josesimoes Feb 8, 2019
682f5c2
Remove target CLR startup
josesimoes Feb 8, 2019
3cbd591
Add dummy blockstorage definition
josesimoes Feb 8, 2019
8ae582d
Add dummy flash driver
josesimoes Feb 8, 2019
25c810b
Add values to flash addresses
josesimoes Feb 8, 2019
cf50a55
Add SimpleLink source files by task
josesimoes Feb 11, 2019
56f27e6
Add SL config file
josesimoes Feb 11, 2019
49dfa30
Add source files for SimpleLink
josesimoes Feb 11, 2019
55ba45a
Add build define to use FreeRTOS
josesimoes Feb 11, 2019
c33ebce
Add target block files
josesimoes Feb 14, 2019
b26e8cd
Update Block Storage stuff to match new structure
josesimoes Feb 20, 2019
602a8b6
Enable execution of CLR thread
josesimoes Feb 20, 2019
d535491
Initial work on block storage configuration
josesimoes Feb 20, 2019
41c3d05
Add Flash driver
josesimoes Feb 20, 2019
2f0e762
Fix BASE_PATH_FOR_CLASS_LIBRARIES_MODULES
josesimoes Feb 21, 2019
017123a
Add missing include path for SimpleLink
josesimoes Feb 21, 2019
30ee6dd
Add compiler defs to target CMake
josesimoes Feb 21, 2019
61c8f95
Adjust deployment region for CLR
josesimoes Feb 21, 2019
38e4887
Clean-up and tidy code
josesimoes Feb 21, 2019
88dd772
Move board files into target folder
josesimoes Feb 21, 2019
b8c4176
Add Devices.Gpio implementation
josesimoes Feb 21, 2019
1d7168e
Implement target implementation of time and hal inline functions
josesimoes Feb 22, 2019
c484672
Enable all GPIO pins on the board
josesimoes Feb 22, 2019
b579b08
Enable all GPIO pins on the board
josesimoes Feb 22, 2019
0c8870f
Add configuration mamager
josesimoes Feb 22, 2019
2288a3b
Add SimpleLink net Wi-Fi source files
josesimoes Feb 22, 2019
12cb4cb
Work on main thread, provisioning and connection tasks
josesimoes Feb 22, 2019
348b7aa
Work on CC32xx configuration manager
josesimoes Feb 26, 2019
cbb4209
Add support for PWM
sjmneves Feb 26, 2019
5555c46
Add support to ADC
sjmneves Feb 26, 2019
cc3fd20
Increased CLR region
sjmneves Feb 28, 2019
a0b25f1
Add support to I2C
sjmneves Mar 1, 2019
bd2d54b
- correct timeout waiting for I2C transfer
sjmneves Mar 1, 2019
3e00d70
- missing changes from last commit
sjmneves Mar 1, 2019
849142f
Add support to SPI
sjmneves Mar 6, 2019
67cb84b
Add windows storage target header
josesimoes Mar 7, 2019
3708550
Implement get network confing block
josesimoes Mar 7, 2019
a4ef490
Adjust flash memory use (2 more blocks)
sjmneves Mar 7, 2019
9101476
Complete provisioning task (task disabled for now)
sjmneves Mar 8, 2019
9a7934e
- Complete ConfigurationManager_GetConfigurationBlock and Configurati…
sjmneves Mar 8, 2019
d29f906
Implement CPU_Reset
josesimoes Mar 8, 2019
bff4c2e
Increase CLR block storage for networking
josesimoes Mar 8, 2019
ae58493
Fix return network config
sjmneves Mar 11, 2019
c303555
Add define for activity heart beat
josesimoes Mar 14, 2019
f09f08e
Add platform implementation of PLATFORM_DELAY
josesimoes Mar 15, 2019
3fb5d01
Add calls to various SimpleLink inits
josesimoes Mar 20, 2019
80ea6ae
Add calls to HAL_AssertEx
josesimoes Mar 20, 2019
25536ea
Fix call to sockets error
josesimoes Mar 20, 2019
69f08b3
Add check for network security on TI SimpleLink RTOS
josesimoes Mar 20, 2019
9c33a5e
Update Devices.Gpio declaration
josesimoes Mar 20, 2019
a6a32b7
Update CC32xx SDK to v2.40.02.00
josesimoes Mar 20, 2019
25be217
Increase CLR region
josesimoes Mar 21, 2019
4aadfc3
Adjust stack size of CLR thread
josesimoes Mar 21, 2019
a55d1e2
Initial support for Simple Link sockets and network interface calls
josesimoes Mar 21, 2019
33aafe2
Increase CLR flash region
josesimoes Mar 21, 2019
d3738fb
Add define for chip family in CMake toolchain
josesimoes Mar 21, 2019
ab4e19a
Add implementation of SNTP for SimpleLink
josesimoes Mar 21, 2019
acd4d29
Moved config block defines to header
josesimoes Mar 23, 2019
906000e
Wrok get and set socket options
josesimoes Mar 23, 2019
54ff521
Fix HAL_CONTINUATION::Dequeue_And_Execute
josesimoes Mar 25, 2019
facae42
Increase CLR region
josesimoes Mar 25, 2019
eb7d76b
Work in equivalent to lwIP drivers and low level functions
josesimoes Mar 25, 2019
241a5b5
Work on configuration manager to store CA root certificate
josesimoes Mar 25, 2019
d233eda
Major code clean-up in main thread
josesimoes Mar 25, 2019
90841fd
Add code to generate default network config block
josesimoes Mar 26, 2019
16b0091
Implement UpdateConfigurationBlock
josesimoes Mar 26, 2019
61585e9
Enable IPv6 on network interface to fix sockets issues
josesimoes Mar 26, 2019
17f4182
Code clean-up
josesimoes Mar 26, 2019
1571b77
Replace CRC32 software calculation with call to hardware engine
josesimoes Mar 29, 2019
c709e4a
Change nF tasks priority to fix
josesimoes Apr 5, 2019
e549bfb
Add managed helper class for GPIO
josesimoes Apr 5, 2019
9946317
Add readme for new target
josesimoes Apr 8, 2019
d6396f2
Add link to doc on how to flash CC3200SF
josesimoes May 4, 2019
efd85e3
Update README with TI_CC3220SF_LAUNCHXL
josesimoes May 4, 2019
0a571af
Update Azure pipelines to build TI_CC3220SF_LAUNCHXL
josesimoes May 4, 2019
cd4f3fb
Add CMake to download TI SimpleLink from repo
josesimoes May 4, 2019
d48c190
Add missing declaration
josesimoes May 4, 2019
5666517
Add missing inclusion of managedf heap ram region
josesimoes May 4, 2019
c388990
Add workaround for linker optimizing functions called in asm code
josesimoes May 5, 2019
3dc2cec
Adjust definition for nanoCLR size in minsizerel
josesimoes May 5, 2019
f94c315
Fox nameof managed helper source file
josesimoes May 6, 2019
451a9cc
Add Azure Pipeline template for TI SimpleLink targets
josesimoes May 6, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion .vscode/launch.TEMPLATE.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,39 @@
"serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
"filterStderr": true,
"externalConsole": true,
"cwd": "${cwd}",
"cwd": "${cwd}"
// Enable the following to debug GDB
//"logging": {
// "engineLogging": true,
// "traceResponse": true
//},
},

{
"MIMode": "gdb",
"name": "CC3200 Launchpad nanoCLR TEMPLATE",
"type": "cppdbg",
"request": "launch",

"setupCommands": [
{"text": "target remote | e:/openocd-0.10.0/bin/openocd.exe -c \"gdb_port pipe; log_output openocd.log\" -f <cc3200.cfg-config-file-usually-in-the-sdk-tools-folder>"},
{"text": "file <absolute-path-to-the-build-folder-mind-the-forward-slashes>/nanoCLR.elf>"},
{"text": "load"},
{"text": "set $sp = g_pfnVectors[0]"},
{"text": "set $pc = g_pfnVectors[1]"},
{"text": "break main"},
{"text": "continue", "ignoreFailures": true }
],

"miDebuggerPath": "<path-to-gdb-inside-the-gcc-toolchain-mind-the-forward-slash>",
"targetArchitecture": "ARM",
"program": "${workspaceRoot}/build/nanoCLR.elf",

"launchCompleteCommand": "None",
"serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
"filterStderr": true,
"externalConsole": true,
"cwd": "${cwd}"
}
]
}
2 changes: 1 addition & 1 deletion CMake/FreeRTOS.CMakeLists.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ExternalProject_Add(
FreeRTOS
PREFIX FreeRTOS
SOURCE_DIR ${CMAKE_BINARY_DIR}/FreeRTOS_Source
SVN_REPOSITORY ${FREERTOS_SVN_REPOSITORY}/FreeRTOS/Source
SVN_REPOSITORY https://svn.code.sf.net/p/freertos/code/tags/${FREERTOS_VERSION_TAG}/FreeRTOS/Source/
TIMEOUT 10
LOG_DOWNLOAD 1
# Disable all other steps
Expand Down
23 changes: 20 additions & 3 deletions CMake/Modules/FindCHIBIOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,23 @@

# check if the series name is supported

set(CHIBIOS_SUPPORTED_SERIES "STM32L0xx" "STM32F0xx" "STM32F4xx" "STM32F7xx" "STM32H7xx" CACHE INTERNAL "supported series names for ChibiOS")
list(FIND CHIBIOS_SUPPORTED_SERIES ${TARGET_SERIES} TARGET_SERIES_NAME_INDEX)
set(CHIBIOS_STM_SUPPORTED_SERIES "STM32F0xx" "STM32F4xx" "STM32F7xx" "STM32H7xx" "TICC3200" CACHE INTERNAL "supported STM series names for ChibiOS")
set(CHIBIOS_TI_SUPPORTED_SERIES "TICC3200" CACHE INTERNAL "supported TI series names for ChibiOS")

list(FIND CHIBIOS_STM_SUPPORTED_SERIES ${TARGET_SERIES} TARGET_SERIES_NAME_INDEX)
if(TARGET_SERIES_NAME_INDEX EQUAL -1)
message(FATAL_ERROR "\n\nSorry but ${TARGET_SERIES} is not supported at this time...\nYou can wait for that to be added or you might want to contribute and start working on a PR for that.\n\n")
# series is NOT supported by STM
# try TI
list(FIND CHIBIOS_TI_SUPPORTED_SERIES ${TARGET_SERIES} TARGET_SERIES_NAME_INDEX)
if(TARGET_SERIES_NAME_INDEX EQUAL -1)
message(FATAL_ERROR "\n\nSorry but ${TARGET_SERIES} is not supported at this time...\nYou can wait for that to be added or you might want to contribute and start working on a PR for that.\n\n")
else()
# series is supported by TI
set(TARGET_VENDOR "TI" CACHE INTERNAL "target vendor is TI")
endif()
else()
# series is supported by STM
set(TARGET_VENDOR "STM" CACHE INTERNAL "target vendor is STM")
endif()

# including here the CMake files for the source files specific to the target series
Expand Down Expand Up @@ -50,6 +63,10 @@ list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/
# append include directory for boards in the nanoFramework ChibiOS 'overlay' provideded by the community
list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets-community/CMSIS-OS/ChibiOS/nf-overlay/os/hal/boards/${CHIBIOS_BOARD})

#
list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/common/ext/CMSIS/TI/${TARGET_SERIES})
list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/targets/CMSIS-OS/ChibiOS/nf-overlay/os/common/startup/ARMCMx/devices/${TARGET_SERIES})


# source files and GCC options according to target vendor and series

Expand Down
1 change: 1 addition & 0 deletions CMake/Modules/FindNF_CoreCLR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ set(NF_CoreCLR_SRCS
TypeSystem.cpp
nanoSupport_CRC32.c
nanoHAL_SystemInformation.cpp
# Various.cpp

# CoreLib
corlib_native_System_AppDomain.cpp
Expand Down
95 changes: 95 additions & 0 deletions CMake/Modules/FindTI_SimpleLink.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#
# Copyright (c) 2019 The nanoFramework project contributors
# See LICENSE file in the project root for full license information.
#

###################################################################################################################################
# WHEN ADDING A NEW series add the respective name to the list bellow along with the CMake files with GCC options and source files
###################################################################################################################################

# check if the series name is supported

set(TI_SIMPLELINK_SUPPORTED_SERIES "CC32xx" CACHE INTERNAL "supported TI series names")

list(FIND TI_SIMPLELINK_SUPPORTED_SERIES ${TARGET_SERIES} TARGET_SERIES_NAME_INDEX)
if(TI_SIMPLELINK_SUPPORTED_SERIES EQUAL -1)
if(TARGET_SERIES_NAME_INDEX EQUAL -1)
message(FATAL_ERROR "\n\nSorry but ${TARGET_SERIES} is not supported at this time...\nYou can wait for that to be added or you might want to contribute and start working on a PR for that.\n\n")
else()
# series is supported by TI
set(TARGET_VENDOR "TI" CACHE INTERNAL "target vendor is TI")
endif()
endif()

# including here the CMake files for the source files specific to the target series
include(TI_SimpleLink_${TARGET_SERIES}_sources)

# and here the GCC options tuned for the target series
include(TI_SimpleLink_${TARGET_SERIES}_GCC_options)

# includes for FreeRTOS
list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/FreeRTOS_Source/include")
list(APPEND TI_SimpleLink_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/FreeRTOS_Source/portable/GCC/ARM_CM3")
list(APPEND TI_SimpleLink_INCLUDE_DIRS "${TARGET_BASE_LOCATION}")

# source files for FreeRTOS
set(FreeRTOS_SRCS

# FreeRTOS
croutine.c
event_groups.c
list.c
queue.c
stream_buffer.c
tasks.c
timers.c
port.c
heap_4.c
clock.c
memory.c
mqueue.c
pthread_barrier.c
pthread_cond.c
pthread.c
pthread_mutex.c
pthread_rwlock.c
sched.c
semaphore.c
sleep.c
timer.c
PTLS.c
aeabi_portable.c
ClockP_freertos.c
DebugP_freertos.c
MutexP_freertos.c
SemaphoreP_freertos.c
SystemP_freertos.c
HwiPCC32XX_freertos.c
PowerCC32XX_freertos.c
startup_cc32xx_gcc.c

)

foreach(SRC_FILE ${FreeRTOS_SRCS})
set(FreeRTOS_SCR_FILE SRC_FILE -NOTFOUND)
find_file(FreeRTOS_SCR_FILE ${SRC_FILE}
PATHS

# FreeRTOS
"${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/posix/freertos"
"${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/ti/source"
"${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/kernel/freertos/dpl"
"${PROJECT_BINARY_DIR}/SimpleLinkCC32xxSDK_Source/kernel/freertos/startup"
"${PROJECT_BINARY_DIR}/FreeRTOS_Source/portable/MemMang"
"${PROJECT_BINARY_DIR}/FreeRTOS_Source/portable/GCC/ARM_CM3"
"${PROJECT_BINARY_DIR}/FreeRTOS_Source"

CMAKE_FIND_ROOT_PATH_BOTH
)
# message("${SRC_FILE} >> ${FreeRTOS_SCR_FILE}") # debug helper
list(APPEND TI_SimpleLink_SOURCES ${FreeRTOS_SCR_FILE})
endforeach()

include(FindPackageHandleStandardArgs)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(TI_SimpleLink DEFAULT_MSG TI_SimpleLink_INCLUDE_DIRS TI_SimpleLink_SOURCES)
48 changes: 48 additions & 0 deletions CMake/Modules/TI_SimpleLink_CC32xx_GCC_options.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# Copyright (c) 2017 The nanoFramework project contributors
# See LICENSE file in the project root for full license information.
#

#################################################################
# WHEN ADDING A NEW SERIES add the appropriate GCC options bellow
#################################################################

# need to specify this for assembler
set(CMAKE_ASM_FLAGS " -mthumb -mcpu=cortex-m4 -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags")

# need to specify linker flags here
# -mfpu=fpv5-sp-d16
set(CMAKE_EXE_LINKER_FLAGS " -Wl,--gc-sections -Wl,--no-wchar-size-warning -Wl,--print-memory-usage -mcpu=cortex-m4 -march=armv7e-m -mthumb -nostartfiles -std=c99 -mfloat-abi=soft -ffunction-sections -fdata-sections -g -gstrict-dwarf -Wall " CACHE INTERNAL "executable linker flags")


function(NF_SET_COMPILER_OPTIONS TARGET)

# include any extra options comming from any extra args?
target_compile_options(${TARGET} PUBLIC ${ARGN} -march=armv7e-m -mthumb -mcpu=cortex-m4 -mfloat-abi=soft -mabi=aapcs -gstrict-dwarf -nostdlib -Wall -w -static -ffunction-sections -falign-functions=16 -fdata-sections -fno-builtin -fno-common -fsingle-precision-constant -fomit-frame-pointer -mlong-calls -fdollars-in-identifiers -fno-exceptions -fno-unroll-loops -mstructure-size-boundary=8 -ffast-math -ftree-vectorize -fcheck-new -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics)

# this series has FPU
target_compile_definitions(${TARGET} PUBLIC -DCORTEX_USE_FPU=TRUE)

endfunction()


function(NF_SET_LINKER_OPTIONS TARGET)

# request specs from newlib nano
set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " --specs=nano.specs ")

# set extra linker flags
set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " ${ARGN}")

# set optimization linker flags for RELEASE and MinSizeRel
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fuse-linker-plugin -Os")
endif()

# set optimization flags
nf_set_optimization_options(${TARGET})

# set link map
nf_set_link_map(${TARGET})

endfunction()
Loading