diff --git a/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/common/Device_BlockStorage-DEBUG.c b/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/common/Device_BlockStorage-DEBUG.c index 1f28f3f30d..478cd4e9b1 100644 --- a/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/common/Device_BlockStorage-DEBUG.c +++ b/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/common/Device_BlockStorage-DEBUG.c @@ -11,8 +11,8 @@ const BlockRange BlockRange1[] = { // the 1st block is reserved for the flash header // so we don't take it into account for the map - { BlockRange_BLOCKTYPE_CODE , 0 , 137 }, // 0x01000800 nanoCLR - { BlockRange_BLOCKTYPE_DEPLOYMENT , 138, 510 }, // 0x01045000 deployment + { BlockRange_BLOCKTYPE_CODE , 0 , 143 }, // 0x01000800 nanoCLR + { BlockRange_BLOCKTYPE_DEPLOYMENT , 144, 510 }, // 0x01048000 deployment }; const BlockRegionInfo BlockRegions[] = diff --git a/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/common/Device_BlockStorage.c b/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/common/Device_BlockStorage.c index 9688dd69b4..8b8b95b655 100644 --- a/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/common/Device_BlockStorage.c +++ b/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/common/Device_BlockStorage.c @@ -11,8 +11,8 @@ const BlockRange BlockRange1[] = { // the 1st block is reserved for the flash header // so we don't take it into account for the map - { BlockRange_BLOCKTYPE_CODE , 0 , 104 }, // 0x01000800 nanoCLR - { BlockRange_BLOCKTYPE_DEPLOYMENT , 105, 510 }, // 0x01034800 deployment + { BlockRange_BLOCKTYPE_CODE , 0 , 109 }, // 0x01000800 nanoCLR + { BlockRange_BLOCKTYPE_DEPLOYMENT , 110, 510 }, // 0x01037000 deployment }; const BlockRegionInfo BlockRegions[] = diff --git a/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/nanoCLR/CC3220SF_CLR-DEBUG.ld b/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/nanoCLR/CC3220SF_CLR-DEBUG.ld index 4e31ff8fdc..240e17aeba 100644 --- a/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/nanoCLR/CC3220SF_CLR-DEBUG.ld +++ b/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/nanoCLR/CC3220SF_CLR-DEBUG.ld @@ -1,34 +1,10 @@ /* - * Copyright (c) 2016-2018, Texas Instruments Incorporated - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +// +// Copyright (c) 2020 The nanoFramework project contributors +// Copyright (c) 2016-2018, Texas Instruments Incorporated +// See LICENSE file in the project root for full license information. +// +*/ /* * ======== CC3220SF_LAUNCHXL_TIRTOS.lds ======== @@ -40,7 +16,7 @@ HEAPSIZE = 0x8000; /* Size of heap buffer used by HeapMem */ MEMORY { FLASH_HDR (RX) : ORIGIN = 0x01000000, LENGTH = 0x7FF - FLASH (RX) : ORIGIN = 0x01000800, LENGTH = 0x045000 + FLASH (RX) : ORIGIN = 0x01000800, LENGTH = 0x048000 SRAM (RWX) : ORIGIN = 0x20000000, LENGTH = 0x00040000 } diff --git a/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/nanoCLR/CC3220SF_CLR.ld b/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/nanoCLR/CC3220SF_CLR.ld index 97f32267e0..06f0f87799 100644 --- a/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/nanoCLR/CC3220SF_CLR.ld +++ b/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/nanoCLR/CC3220SF_CLR.ld @@ -1,34 +1,10 @@ /* - * Copyright (c) 2016-2018, Texas Instruments Incorporated - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +// +// Copyright (c) 2020 The nanoFramework project contributors +// Copyright (c) 2016-2018, Texas Instruments Incorporated +// See LICENSE file in the project root for full license information. +// +*/ /* * ======== CC3220SF_LAUNCHXL_TIRTOS.lds ======== @@ -40,7 +16,7 @@ HEAPSIZE = 0x8000; /* Size of heap buffer used by HeapMem */ MEMORY { FLASH_HDR (RX) : ORIGIN = 0x01000000, LENGTH = 0x7FF - FLASH (RX) : ORIGIN = 0x01000800, LENGTH = 0x034800 + FLASH (RX) : ORIGIN = 0x01000800, LENGTH = 0x037000 SRAM (RWX) : ORIGIN = 0x20000000, LENGTH = 0x00040000 } diff --git a/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/nanoCLR/main.c b/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/nanoCLR/main.c index b8f9ced6b0..af1d6ac255 100644 --- a/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/nanoCLR/main.c +++ b/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/nanoCLR/main.c @@ -6,11 +6,12 @@ #include #include +// POSIX Header files +#include +#include + // RTOS header files -#include -#include #include -#include // board Header files #include @@ -20,33 +21,21 @@ // Stack size in bytes #define THREADSTACKSIZE 2048 -Task_Handle receiverHandle; -Task_Handle clrHandle; - CLR_SETTINGS clrSettings; -extern void ReceiverThread(UArg arg0, UArg arg1); -extern void CLRStartupThread(UArg arg0, UArg arg1); +extern void * mainThread(void *arg); int main(void) { - Task_Params taskParams; + pthread_t thread; + pthread_attr_t threadAttributes; + struct sched_param priorityParameters; + + int retc; // Call board init functions Board_initGeneral(); - // setup Task thread - Task_Params_init(&taskParams); - taskParams.stackSize = THREADSTACKSIZE; - taskParams.priority = 4; - - // create Receiver - receiverHandle = Task_create((Task_FuncPtr)ReceiverThread, &taskParams, Error_IGNORE); - if (receiverHandle == NULL) - { - while (1); - } - // CLR settings to launch CLR thread (void)memset(&clrSettings, 0, sizeof(CLR_SETTINGS)); @@ -54,25 +43,23 @@ int main(void) clrSettings.WaitForDebugger = false; clrSettings.EnterDebuggerLoopAfterExit = true; - // setup CLR task - taskParams.arg0 = (UArg)&clrSettings; - taskParams.stackSize = THREADSTACKSIZE; - taskParams.priority = 4; - clrHandle = Task_create(CLRStartupThread, &taskParams, Error_IGNORE); - if (clrHandle == NULL) + // Set priority and stack size attributes + pthread_attr_init(&threadAttributes); + priorityParameters.sched_priority = 1; + + retc = pthread_attr_setdetachstate(&threadAttributes, PTHREAD_CREATE_DETACHED); + + pthread_attr_setschedparam(&threadAttributes, &priorityParameters); + retc |= pthread_attr_setstacksize(&threadAttributes, THREADSTACKSIZE); + retc |= pthread_create(&thread, &threadAttributes, mainThread, &clrSettings); + if(retc != 0) { - while (1); + while(1) + { + ; + } } - GPIO_init(); - UART_init(); - ConfigUART(); - - // Switch off all LEDs on board - GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_OFF); - GPIO_write(Board_GPIO_LED1, Board_GPIO_LED_OFF); - GPIO_write(Board_GPIO_LED2, Board_GPIO_LED_OFF); - BIOS_start(); return (0); diff --git a/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/ti-rtos-debug.cfg b/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/ti-rtos-debug.cfg index 53a2c5f1b5..f7eaed6553 100644 --- a/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/ti-rtos-debug.cfg +++ b/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/ti-rtos-debug.cfg @@ -1,34 +1,10 @@ /* - * Copyright (c) 2015-2017, Texas Instruments Incorporated - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +// +// Copyright (c) 2020 The nanoFramework project contributors +// Copyright (c) 2016-2018, Texas Instruments Incorporated +// See LICENSE file in the project root for full license information. +// +*/ diff --git a/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/ti-rtos-release.cfg b/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/ti-rtos-release.cfg index ecac87c7d5..bd0d5a7f2b 100644 --- a/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/ti-rtos-release.cfg +++ b/targets/TI-SimpleLink/TI_CC3220SF_LAUNCHXL/ti-rtos-release.cfg @@ -1,34 +1,10 @@ /* - * Copyright (c) 2015-2017, Texas Instruments Incorporated - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +// +// Copyright (c) 2020 The nanoFramework project contributors +// Copyright (c) 2016-2018, Texas Instruments Incorporated +// See LICENSE file in the project root for full license information. +// +*/ diff --git a/targets/TI-SimpleLink/nanoCLR/targetSimpleLinkCC32xx_Threads.c b/targets/TI-SimpleLink/nanoCLR/targetSimpleLinkCC32xx_Threads.c index 9f64f1c0cd..b99b924a51 100644 --- a/targets/TI-SimpleLink/nanoCLR/targetSimpleLinkCC32xx_Threads.c +++ b/targets/TI-SimpleLink/nanoCLR/targetSimpleLinkCC32xx_Threads.c @@ -679,8 +679,10 @@ void * mainThread(void *arg) // initialize the realtime clock clock_settime(CLOCK_REALTIME, &ts); - // Switch off all LEDs on boards + // Switch off all LEDs on board GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_OFF); + GPIO_write(Board_GPIO_LED1, Board_GPIO_LED_OFF); + GPIO_write(Board_GPIO_LED2, Board_GPIO_LED_OFF); // clear SimpleLink Status nF_ControlBlock.Status = 0; @@ -810,7 +812,7 @@ void * mainThread(void *arg) pthread_attr_init(&threadAttributes); priorityParams.sched_priority = NF_TASK_PRIORITY; retc = pthread_attr_setschedparam(&threadAttributes, &priorityParams); - retc |= pthread_attr_setstacksize(&threadAttributes, 1024); + retc |= pthread_attr_setstacksize(&threadAttributes, THREADSTACKSIZE); if (retc != 0) { // failed to set attributes @@ -833,7 +835,7 @@ void * mainThread(void *arg) pthread_attr_init(&threadAttributes); priorityParams.sched_priority = NF_TASK_PRIORITY; retc = pthread_attr_setschedparam(&threadAttributes, &priorityParams); - retc |= pthread_attr_setstacksize(&threadAttributes, 7168); + retc |= pthread_attr_setstacksize(&threadAttributes, THREADSTACKSIZE); if (retc != 0) { // failed to set attributes