diff --git a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/abslayer/hal_core_cfg.c b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/abslayer/hal_core_cfg.c index 1caa4c471..c9038aa65 100644 --- a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/abslayer/hal_core_cfg.c +++ b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/abslayer/hal_core_cfg.c @@ -27,11 +27,17 @@ // - external dependencies // -------------------------------------------------------------------------------------------------------------------- -#include "stdlib.h" -#include "hal_core.h" +#undef DONTUSE_EOtheFatalError + +#if !defined(DONTUSE_EOtheFatalError) + #include "EOtheFatalError.h" +#else + #include "EOtheErrorManager.h" + #include "EoError.h" + #include "hal_trace.h" + #include "hal_led.h" +#endif -#include "EOtheErrorManager.h" -#include "EoError.h" // -------------------------------------------------------------------------------------------------------------------- @@ -80,11 +86,17 @@ const hal_core_cfg_t hal_cfg = const hal_core_cfg_t *hal_coreCFGptr = &hal_cfg; -#include "hal_trace.h" -#include "hal_led.h" - static void s_hal_core_cfg_on_fatalerror(hal_fatalerror_t errorcode, const char * errormsg) { +#if !defined(DONTUSE_EOtheFatalError) + // in here there is just a test of emission of ipc data w/ a restart + fatal_error_descriptor_t *des = eo_fatalerror_GetDescriptor(eo_fatalerror_GetHandle()); + des->handlertype = fatalerror_handler_hal; + des->handlererrorcode = errorcode; + des->param = NULL; + eo_fatalerror_Restart(eo_fatalerror_GetHandle(), des); +#else + #warning DONTUSE_EOtheFatalError is defined, are you sure? if(eobool_true == eo_errman_IsErrorHandlerConfigured(eo_errman_GetHandle())) { // ok ... use the error manager, either in its simple form or in its networked form @@ -135,6 +147,8 @@ static void s_hal_core_cfg_on_fatalerror(hal_fatalerror_t errorcode, const char hal_led_toggle(hal_led5); } } +#endif + } #include "osal_base.h" @@ -143,12 +157,66 @@ static void* myheap_new(uint32_t size) { return(osal_base_memory_new(size)); } + static void myheap_delete(void* mem) { osal_base_memory_del(mem); } +#if !defined(DONTUSE_EOtheFatalError) + +void hw_handler(fatal_error_handler_t feh) +{ + fatal_error_descriptor_t *des = eo_fatalerror_GetDescriptor(eo_fatalerror_GetHandle()); + des->handlertype = feh; + des->handlererrorcode = 100; + des->forfutureuse0 = 0x12; + des->forfutureuse1 = 0x23; + des->param = NULL; + eo_fatalerror_Restart(eo_fatalerror_GetHandle(), des); +} + +void NMI_Handler(void) +{ + hw_handler(fatalerror_handler_hw_NMI); +} + +void HardFault_Handler(void) +{ + hw_handler(fatalerror_handler_hw_HardFault); +} + +void MemManage_Handler(void) +{ + hw_handler(fatalerror_handler_hw_MemManage); +} + +void BusFault_Handler(void) +{ + hw_handler(fatalerror_handler_hw_BusFault); +} + +void UsageFault_Handler(void) +{ + hw_handler(fatalerror_handler_hw_UsageFault); +} + +void DebugMon_Handler(void) +{ + hw_handler(fatalerror_handler_hw_DebugMon); +} + +void Default_Handler(void) +{ + hw_handler(fatalerror_handler_hw_Default); +} + +void RTC_Alarm_IRQHandler(void) +{ + hw_handler(fatalerror_handler_hw_Default); +} +#endif // -------------------------------------------------------------------------------------------------------------------- diff --git a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/abslayer/ipal_cfg.c b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/abslayer/ipal_cfg.c index 3af960ea6..7edff0a14 100644 --- a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/abslayer/ipal_cfg.c +++ b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/abslayer/ipal_cfg.c @@ -27,17 +27,22 @@ // - external dependencies // -------------------------------------------------------------------------------------------------------------------- -#include "EOtheErrorManager.h" -#include "EoError.h" +#undef DONTUSE_EOtheFatalError - -#include "ipal.h" +#if !defined(DONTUSE_EOtheFatalError) + #include "EOtheFatalError.h" +#else + #include "EOtheErrorManager.h" + #include "EoError.h" + #include "hal_trace.h" + #include "hal_led.h" +#endif +#include "ipal.h" #include "hal.h" #include "osal.h" - // -------------------------------------------------------------------------------------------------------------------- // - declaration of extern public interface // -------------------------------------------------------------------------------------------------------------------- @@ -169,7 +174,14 @@ static void onethframerx(void) static void s_ipal_cfg_on_fatal_error(ipal_fatalerror_t errorcode, const char * errormsg) { - +#if !defined(DONTUSE_EOtheFatalError) + fatal_error_descriptor_t *des = eo_fatalerror_GetDescriptor(eo_fatalerror_GetHandle()); + des->handlertype = fatalerror_handler_ipal; + des->handlererrorcode = errorcode; + des->param = NULL; + eo_fatalerror_Restart(eo_fatalerror_GetHandle(), des); +#else + #warning DONTUSE_EOtheFatalError is defined, are you sure? char str[256]; if(eobool_true == eo_errman_IsErrorHandlerConfigured(eo_errman_GetHandle())) @@ -218,6 +230,7 @@ static void s_ipal_cfg_on_fatal_error(ipal_fatalerror_t errorcode, const char * hal_led_toggle(hal_led5); } } +#endif } diff --git a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/abslayer/osal_cfg.c b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/abslayer/osal_cfg.c index 6f7d02f64..3b2cedb16 100644 --- a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/abslayer/osal_cfg.c +++ b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/abslayer/osal_cfg.c @@ -27,20 +27,22 @@ // - external dependencies // -------------------------------------------------------------------------------------------------------------------- -#include "stdio.h" -#include "string.h" -#include "osal.h" -#include "osal_arch_arm.h" -#include "hal_trace.h" -#include "stdlib.h" +#undef DONTUSE_EOtheFatalError + +#if !defined(DONTUSE_EOtheFatalError) + #include "EOtheFatalError.h" +#else + #include "EOtheErrorManager.h" + #include "EoError.h" + #include "hal_trace.h" + #include "hal_sys.h" + #include "hal_led.h" +#endif -#include "hal_led.h" -#include "hal_sys.h" -#include "EOtheErrorManager.h" -#include "EoError.h" +#include "osal.h" +#include "osal_arch_arm.h" -#include "embOBJporting.h" // -------------------------------------------------------------------------------------------------------------------- // - declaration of extern public interface @@ -112,6 +114,14 @@ const osal_cfg_t *osal_cfgMINEX = &osal_cfg; static void s_osal_cfg_on_fatal_error(void* task, osal_fatalerror_t errorcode, const char * errormsg) { +#if !defined(DONTUSE_EOtheFatalError) + fatal_error_descriptor_t *des = eo_fatalerror_GetDescriptor(eo_fatalerror_GetHandle()); + des->handlertype = fatalerror_handler_osal; + des->handlererrorcode = errorcode; + des->param = task; + eo_fatalerror_Restart(eo_fatalerror_GetHandle(), des); +#else + #warning DONTUSE_EOtheFatalError is defined, are you sure? uint8_t tskid = 0; char str[64]; osal_task_id_get((osal_task_t*)task, &tskid); @@ -163,7 +173,7 @@ static void s_osal_cfg_on_fatal_error(void* task, osal_fatalerror_t errorcode, c hal_led_toggle(hal_led5); } } - +#endif } static void s_osal_cfg_on_idle(void) diff --git a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/eoemsappl/EOMtheEMSapplCfg_cfg.h b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/eoemsappl/EOMtheEMSapplCfg_cfg.h index 08b532866..8c7b510e6 100644 --- a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/eoemsappl/EOMtheEMSapplCfg_cfg.h +++ b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/cfg/eoemsappl/EOMtheEMSapplCfg_cfg.h @@ -75,7 +75,7 @@ extern "C" { #define EOMTHEEMSAPPLCFG_VERSION_MAJOR 3 // minor <0-255> // minor <0-255> -#define EOMTHEEMSAPPLCFG_VERSION_MINOR 41 +#define EOMTHEEMSAPPLCFG_VERSION_MINOR 42 // version @@ -85,9 +85,9 @@ extern "C" { // month <1-12> #define EOMTHEEMSAPPLCFG_BUILDDATE_MONTH 6 // day <1-31> -#define EOMTHEEMSAPPLCFG_BUILDDATE_DAY 9 +#define EOMTHEEMSAPPLCFG_BUILDDATE_DAY 22 // hour <0-23> -#define EOMTHEEMSAPPLCFG_BUILDDATE_HOUR 17 +#define EOMTHEEMSAPPLCFG_BUILDDATE_HOUR 10 // minute <0-59> #define EOMTHEEMSAPPLCFG_BUILDDATE_MIN 11 // build date diff --git a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/proj/ems4rd.diagnostic2ready.uvoptx b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/proj/ems4rd.diagnostic2ready.uvoptx index 1c582cf2b..214a7b0f2 100644 --- a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/proj/ems4rd.diagnostic2ready.uvoptx +++ b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/proj/ems4rd.diagnostic2ready.uvoptx @@ -120,12 +120,12 @@ 0 ARMRTXEVENTFLAGS - -L200 -Z12 -C0 -M1 -T1 + -L200 -Z15 -C0 -M1 -T1 0 ULP2CM3 - -UP1123199 -O207 -S12 -C0 -P00000000 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO65555 -TC168000000 -TT168000000 -TP18 -TDX0 -TDD0 -TDS8000 -TDT0 -TDC1F -TIE80000001 -TIP9 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407IG$CMSIS\Flash\STM32F4xx_1024.FLM) + -UP0948199 -O207 -S12 -C0 -P00000000 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO65555 -TC168000000 -TT168000000 -TP18 -TDX0 -TDD0 -TDS8000 -TDT0 -TDC1F -TIE80000001 -TIP9 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407IG$CMSIS\Flash\STM32F4xx_1024.FLM) 0 @@ -162,34 +162,34 @@ 0 0 - 967 + 146 1 -
134467048
+
134411634
0 0 0 0 0 1 - ..\src\eoappservices\testRTC.c + ..\src\eoappservices\EOtheFatalError.c - \\ems004\../src/eoappservices/testRTC.c\967 + \\ems004\../src/eoappservices/EOtheFatalError.c\146
1 0 - 1005 + 145 1 -
134467210
+
0
0 0 0 0 0 - 1 - ..\src\eoappservices\testRTC.c + 0 + ..\src\eoappservices\EOtheFatalError.c - \\ems004\../src/eoappservices/testRTC.c\1005 +
@@ -201,12 +201,47 @@ 1 1 - p->pos + s_eo_thefatalerror 2 1 - ropsnum + tsk + + + 3 + 1 + nameofirqhan + + + 4 + 1 + s_irqh + + + 5 + 1 + str + + + 6 + 1 + task_context + + + 7 + 1 + os_tsk,0x0A + + + 8 + 1 + des + + + 9 + 1 + thrname @@ -230,7 +265,7 @@ 1 0 - 0x20002C8E + 0x20007468 0 @@ -281,7 +316,7 @@ 0 0 0 - 1 + 0 1 0 0 @@ -1614,7 +1649,7 @@ main - 0 + 1 0 0 0 @@ -2298,7 +2333,7 @@ eo-emsappl - 1 + 0 0 0 0 @@ -2450,7 +2485,7 @@ eo-emsappl-cfg - 1 + 0 0 0 0 @@ -2830,6 +2865,18 @@ 0 0 + + 13 + 94 + 1 + 0 + 0 + 0 + ..\src\eoappservices\EOtheFatalError.c + EOtheFatalError.c + 0 + 0 + @@ -2840,7 +2887,7 @@ 0 14 - 94 + 95 1 0 0 @@ -2852,7 +2899,7 @@ 14 - 95 + 96 1 0 0 @@ -2864,7 +2911,7 @@ 14 - 96 + 97 1 0 0 @@ -2876,7 +2923,7 @@ 14 - 97 + 98 1 0 0 @@ -2888,7 +2935,7 @@ 14 - 98 + 99 1 0 0 @@ -2900,7 +2947,7 @@ 14 - 99 + 100 1 0 0 @@ -2912,7 +2959,7 @@ 14 - 100 + 101 1 0 0 @@ -2924,7 +2971,7 @@ 14 - 101 + 102 1 0 0 @@ -2936,7 +2983,7 @@ 14 - 102 + 103 1 0 0 @@ -2956,7 +3003,7 @@ 0 15 - 103 + 104 1 0 0 @@ -2968,7 +3015,7 @@ 15 - 104 + 105 1 0 0 @@ -2980,7 +3027,7 @@ 15 - 105 + 106 1 0 0 @@ -2992,7 +3039,7 @@ 15 - 106 + 107 1 0 0 @@ -3004,7 +3051,7 @@ 15 - 107 + 108 1 0 0 @@ -3016,7 +3063,7 @@ 15 - 108 + 109 1 0 0 @@ -3028,7 +3075,7 @@ 15 - 109 + 110 1 0 0 @@ -3040,7 +3087,7 @@ 15 - 110 + 111 1 0 0 @@ -3052,7 +3099,7 @@ 15 - 111 + 112 1 0 0 @@ -3064,7 +3111,7 @@ 15 - 112 + 113 1 0 0 @@ -3076,7 +3123,7 @@ 15 - 113 + 114 1 0 0 @@ -3088,7 +3135,7 @@ 15 - 114 + 115 1 0 0 @@ -3100,7 +3147,7 @@ 15 - 115 + 116 1 0 0 @@ -3112,7 +3159,7 @@ 15 - 116 + 117 1 0 0 @@ -3124,7 +3171,7 @@ 15 - 117 + 118 1 0 0 @@ -3138,13 +3185,13 @@ eo-protocol - 0 + 1 0 0 0 16 - 118 + 119 1 0 0 @@ -3156,7 +3203,7 @@ 16 - 119 + 120 1 0 0 @@ -3168,7 +3215,7 @@ 16 - 120 + 121 1 0 0 @@ -3180,7 +3227,7 @@ 16 - 121 + 122 1 0 0 @@ -3192,7 +3239,7 @@ 16 - 122 + 123 1 0 0 @@ -3204,7 +3251,7 @@ 16 - 123 + 124 1 0 0 @@ -3216,7 +3263,7 @@ 16 - 124 + 125 1 0 0 @@ -3228,7 +3275,7 @@ 16 - 125 + 126 1 0 0 @@ -3240,7 +3287,7 @@ 16 - 126 + 127 1 0 0 @@ -3252,7 +3299,7 @@ 16 - 127 + 128 1 0 0 @@ -3264,7 +3311,7 @@ 16 - 128 + 129 1 0 0 @@ -3276,7 +3323,7 @@ 16 - 129 + 130 1 0 0 @@ -3288,7 +3335,7 @@ 16 - 130 + 131 1 0 0 @@ -3300,7 +3347,7 @@ 16 - 131 + 132 1 0 0 @@ -3312,7 +3359,7 @@ 16 - 132 + 133 1 0 0 @@ -3324,7 +3371,7 @@ 16 - 133 + 134 1 0 0 @@ -3344,7 +3391,7 @@ 0 17 - 134 + 135 1 0 0 @@ -3356,7 +3403,7 @@ 17 - 135 + 136 1 0 0 @@ -3368,7 +3415,7 @@ 17 - 136 + 137 1 0 0 @@ -3380,7 +3427,7 @@ 17 - 137 + 138 1 0 0 @@ -3400,7 +3447,7 @@ 0 18 - 138 + 139 1 0 0 @@ -3412,7 +3459,7 @@ 18 - 139 + 140 1 0 0 @@ -3424,7 +3471,7 @@ 18 - 140 + 141 1 0 0 @@ -3444,7 +3491,7 @@ 0 19 - 141 + 142 1 0 0 @@ -3456,7 +3503,7 @@ 19 - 142 + 143 1 0 0 @@ -3468,7 +3515,7 @@ 19 - 143 + 144 1 0 0 @@ -3480,7 +3527,7 @@ 19 - 144 + 145 1 0 0 @@ -3492,7 +3539,7 @@ 19 - 145 + 146 1 0 0 @@ -3504,7 +3551,7 @@ 19 - 146 + 147 1 0 0 @@ -3524,7 +3571,7 @@ 0 20 - 147 + 148 1 0 0 @@ -3536,7 +3583,7 @@ 20 - 148 + 149 1 0 0 @@ -3556,7 +3603,7 @@ 0 21 - 149 + 150 8 0 0 @@ -3568,7 +3615,7 @@ 21 - 150 + 151 8 0 0 @@ -3580,7 +3627,7 @@ 21 - 151 + 152 8 0 0 @@ -3592,7 +3639,7 @@ 21 - 152 + 153 8 0 0 @@ -3612,7 +3659,7 @@ 0 22 - 153 + 154 8 0 0 @@ -3624,7 +3671,7 @@ 22 - 154 + 155 8 0 0 @@ -3636,7 +3683,7 @@ 22 - 155 + 156 8 0 0 @@ -3648,7 +3695,7 @@ 22 - 156 + 157 8 0 0 @@ -3660,7 +3707,7 @@ 22 - 157 + 158 8 0 0 diff --git a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/proj/ems4rd.diagnostic2ready.uvprojx b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/proj/ems4rd.diagnostic2ready.uvprojx index 8012112eb..64c416e5b 100644 --- a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/proj/ems4rd.diagnostic2ready.uvprojx +++ b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/proj/ems4rd.diagnostic2ready.uvprojx @@ -10,7 +10,7 @@ ems4rd 0x4 ARM-ADS - 6150000::V6.15::ARMCLANG + 6160000::V6.16::ARMCLANG 1 @@ -908,6 +908,11 @@ 1 ..\src\eoappservices\EOthePOS.c + + EOtheFatalError.c + 1 + ..\src\eoappservices\EOtheFatalError.c + @@ -2317,6 +2322,11 @@ 1 ..\src\eoappservices\EOthePOS.c + + EOtheFatalError.c + 1 + ..\src\eoappservices\EOtheFatalError.c + diff --git a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOtheFatalError.c b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOtheFatalError.c new file mode 100644 index 000000000..c3667bfa8 --- /dev/null +++ b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOtheFatalError.c @@ -0,0 +1,698 @@ + +/* + * Copyright (C) 2021 iCub Tech - Istituto Italiano di Tecnologia + * Author: Marco Accame + * email: marco.accame@iit.it +*/ + + + +// -------------------------------------------------------------------------------------------------------------------- +// - external dependencies +// -------------------------------------------------------------------------------------------------------------------- + +#include "eEsharedServices.h" +#include "osal.h" +#include "hal.h" +#include "EoError.h" +#include "EOMtask.h" + +// -------------------------------------------------------------------------------------------------------------------- +// - declaration of extern public interface +// -------------------------------------------------------------------------------------------------------------------- + +#include "EOtheFatalError.h" + + +// -------------------------------------------------------------------------------------------------------------------- +// - declaration of extern hidden interface +// -------------------------------------------------------------------------------------------------------------------- + +#include "EOtheFatalError_hid.h" + + +// -------------------------------------------------------------------------------------------------------------------- +// - #define with internal scope +// -------------------------------------------------------------------------------------------------------------------- + +//#define EOTHEFATALERROR_ACTIVATE_TEST + + +// -------------------------------------------------------------------------------------------------------------------- +// - definition (and initialisation) of extern variables. deprecated: better using _get(), _set() on static variables +// -------------------------------------------------------------------------------------------------------------------- +// empty-section + +// -------------------------------------------------------------------------------------------------------------------- +// - typedef with internal scope +// -------------------------------------------------------------------------------------------------------------------- +// empty-section + + +// -------------------------------------------------------------------------------------------------------------------- +// - declaration of static functions +// -------------------------------------------------------------------------------------------------------------------- + +static const char * s_fatalerror2string(fatal_error_handler_t feh); +static const char * s_get_threadstring(const char *s, osal_task_id_t tid); +static const char * s_get_irqhandlerstring(uint8_t ipsr); +static uint32_t s_getmillitime(void); +static const char * s_get_threadinfo(const fatal_error_descriptor_t *des, osal_task_id_t *tid); +static const char * s_get_fatalerrorstring(uint8_t h, uint8_t ec); + +static const char * s_tid_to_threadname(osal_task_id_t tid); + +static void s_test(fatal_error_descriptor_t *des); + +static void s_save_standard(fatal_error_descriptor_t *des); +static void s_info_standard(EOtheFatalError *p); + +static void s_save_hardfault(fatal_error_descriptor_t *des); +static void s_info_hardfault(EOtheFatalError *p); + +// -------------------------------------------------------------------------------------------------------------------- +// - definition (and initialisation) of static variables +// -------------------------------------------------------------------------------------------------------------------- + +static EOtheFatalError s_eo_thefatalerror = +{ + .initted = eobool_false, + .threadcount = 0, + .descriptor = {0}, + .tobewritten = {0}, + .detectedfatalerror = {0}, + .errdes = {0}, + .threads = + { + {0, ""}, {0, ""}, {0, ""}, {0, ""}, {0, ""}, {0, ""}, {0, ""}, {0, ""}, + {0, ""}, {0, ""}, {0, ""}, {0, ""}, {0, ""}, {0, ""}, {0, ""}, {0, ""} + } +}; + +static const char s_eobj_ownname[] = "EOtheFatalError"; + +// -------------------------------------------------------------------------------------------------------------------- +// - definition of extern public functions +// -------------------------------------------------------------------------------------------------------------------- + + +extern EOtheFatalError* eo_fatalerror_Initialise(void) +{ + EOtheFatalError *p = &s_eo_thefatalerror; + + if(eobool_true == p->initted) + { + return(p); + } + +// eo_errman_Trace(eo_errman_GetHandle(), "eo_fatalerror_Initialise() starts", s_eobj_ownname); + + p->initted = eobool_true; + + // for the rest we rely on the static initialisation of s_eo_thefatalerror + +// eo_errman_Trace(eo_errman_GetHandle(), "eo_fatalerror_Initialise() is over", s_eobj_ownname); + + return(p); +} + + +extern EOtheFatalError* eo_fatalerror_GetHandle(void) +{ + EOtheFatalError *p = &s_eo_thefatalerror; + + if(eobool_true == p->initted) + { + return(p); + } + + return(NULL); +} + + + +extern void eo_fatalerror_AtStartup(EOtheFatalError *p) +{ + if(NULL == p) + { + p = eo_fatalerror_Initialise(); + } + + uint8_t detectedsize = 0; + // read ipc memory + if(ee_res_OK == ee_sharserv_ipc_userdefdata_get((uint8_t*)&p->detectedfatalerror, &detectedsize, sizeof(fatal_error_t))) + { + // there is something. + // i clear ipc ram + ee_sharserv_ipc_userdefdata_clr(); + if((detectedsize <= sharserv_base_ipc_userdefdata_maxsize) && (fatal_error_signature == p->detectedfatalerror.message.signature)) + { + if(fatalerror_handler_hw_HardFault == p->detectedfatalerror.message.handlertype) + { + s_info_hardfault(p); + } + else + { + s_info_standard(p); + } + } + } + +} + + +extern fatal_error_descriptor_t * eo_fatalerror_GetDescriptor(EOtheFatalError *p) +{ + return &s_eo_thefatalerror.descriptor; +} + +extern void eo_fatalerror_Restart(EOtheFatalError *p, fatal_error_descriptor_t *des) +{ + // must be lean and mean. we dont check vs p + if(NULL == des) + { + des = &s_eo_thefatalerror.descriptor; + } + + if(fatalerror_handler_hw_HardFault == des->handlertype) + { + s_save_hardfault(des); + } + else + { + s_save_standard(des); + } + + + // write in ipc memory and ... restart + ee_sharserv_ipc_userdefdata_set((uint8_t*)&s_eo_thefatalerror.tobewritten, sizeof(s_eo_thefatalerror.tobewritten)); + ee_sharserv_sys_restart(); + +} + +extern void eo_fatalerror_Test(EOtheFatalError *p, fatal_error_descriptor_t *des) +{ + s_test(des); +} + + + +extern void eo_fatalerror_RegisterThread(EOtheFatalError *p, void *t, const char *n) +{ + if(s_eo_thefatalerror.threadcount < maxthreads) + { +// s_eo_thefatalerror.threads[s_eo_thefatalerror.threadcount].t = t; + osal_task_id_get(t, &s_eo_thefatalerror.threads[s_eo_thefatalerror.threadcount].tid); + snprintf(s_eo_thefatalerror.threads[s_eo_thefatalerror.threadcount].nameof, threadnameofsize, "%s", n); + s_eo_thefatalerror.threadcount ++; + } +} + +// -------------------------------------------------------------------------------------------------------------------- +// - definition of extern hidden functions +// -------------------------------------------------------------------------------------------------------------------- + + + +// -------------------------------------------------------------------------------------------------------------------- +// - definition of static functions +// -------------------------------------------------------------------------------------------------------------------- + + +static const char * s_fatalerror2string(fatal_error_handler_t feh) +{ + static const char * s_fatalerror_strings[] = + { + "none", + "unknown", + "HAL", + "OSAL", + "IPAL", + "hw_NMI", + "hw_HardFault", + "hw_MemManage", + "hw_BusFault", + "hw_UsageFault", + "hw_DebugMon", + "hw_Default" + }; EO_VERIFYsizeof(s_fatalerror_strings, fatal_error_handler_numbersof*sizeof(const char *)) + + const char * ret = s_fatalerror_strings[fatalerrr_handler_unknown]; + + if(feh < fatal_error_handler_numbersof) + { + ret = s_fatalerror_strings[feh]; + } + + return ret; +} + +#if 0 + + osal_task_t * osalt = NULL; + if((fatalerror_handler_osal == des->handlertype) && (NULL != des->param)) + { + osalt = des->param; + osal_task_id_get(osalt, &tid); + } + else + { + osalt = osal_task_get(osal_callerAUTOdetect); + osal_task_id_get(osalt, &tid); + } + + //uint8_t irqh = (hal_true == hal_sys_irq_is_running()) ? 1 : 0; + + s_eo_thefatalerror.tobewritten.message.millisecondsfromstart = s_getmillitime(); + s_eo_thefatalerror.tobewritten.message.handlertype = des->handlertype; + s_eo_thefatalerror.tobewritten.message.handlererrorcode = des->handlererrorcode; + s_eo_thefatalerror.tobewritten.message.ipsr = hal_sys_get_IPSR(); + s_eo_thefatalerror.tobewritten.message.idofthelastscheduledthread = tid; + + // get name of the scheduled thread + EOMtask * tsk = (EOMtask*)osal_task_extdata_get(osalt); + thrname = eom_task_GetName(tsk); + + if(NULL == tsk) + { + for(int i=0; i<16; i++) + { + if(s_eo_thefatalerror.threads[i].t == osalt) + { + thrname = s_eo_thefatalerror.threads[i].nameof; + } + } + } + +#endif + +static const char * s_get_threaname_mode1(fatal_error_descriptor_t *des) +{ + // get name of the scheduled thread. the code is safe also if we have NULL + EOMtask * tsk = (EOMtask*)osal_task_extdata_get(osal_task_get(osal_callerAUTOdetect)); + return(eom_task_GetName(tsk)); +} + +extern void * oosiit_tsk_self(void); +extern uint8_t oosiit_tsk_get_id(void * tp); + +static const char * s_get_threaname_mode2(const fatal_error_descriptor_t *des, osal_task_id_t *ptid) +{ +// osal_task_id_t tid1 = 0; +// osal_task_id_get(osal_task_get(osal_callerAUTOdetect), &tid1); +// volatile osal_task_id_t tid2 = tid1; +// tid2 = tid2; + + osal_task_id_t tid = oosiit_tsk_get_id(oosiit_tsk_self()); + *ptid = tid; + + return s_tid_to_threadname(tid); + +} + +static const char * s_get_threadinfo(const fatal_error_descriptor_t *des, osal_task_id_t *tid) +{ + // how to get the name of the thread? + // there are several ways. + // the quickest and cleanest way is to get it directly from the EOMtask through the osal_task_t. + // see function s_get_threaname_mode1() + // however, i have experienced that this mode does not work when we have a stack overflow + // because the stack memory is close by the RAM used for description of osal_task_t and EOMtask. + // so, i have implemented a second way, where we look for a private look up table + + return(s_get_threaname_mode2(des, tid)); +} + +static const char * s_tid_to_threadname(osal_task_id_t tid) +{ + const char * thrname = NULL; + + for(uint8_t i=0; i= 0xE0) && (ec <= 0xE5)) + { + return s_ose[ec-0xE0]; + } + + return "see TBL"; +} + + +static const char * s_get_threadstring(const char *s, osal_task_id_t tid) +{ + const char *name = s; + // or even better: we may match the start of the string with our own copy inside s_eo_thefatalerror.threads + + return s; +} + +static uint32_t s_getmillitime(void) +{ + // using oosiit_time and osal_info_get_tick() we DONT call the SVC handler, + // so we have better possibility of success even in case of fatal disaster... + extern volatile uint64_t oosiit_time; + uint64_t ms = oosiit_time * osal_info_get_tick() / 1000; + + return ms; +} + +static void s_save_standard(fatal_error_descriptor_t *des) +{ + osal_task_id_t tid = 0; + const char *thrname = s_get_threadinfo(des, &tid); + + s_eo_thefatalerror.tobewritten.message.millisecondsfromstart = s_getmillitime(); + s_eo_thefatalerror.tobewritten.message.handlertype = des->handlertype; + s_eo_thefatalerror.tobewritten.message.handlererrorcode = des->handlererrorcode; + s_eo_thefatalerror.tobewritten.message.ipsr = hal_sys_get_IPSR(); + s_eo_thefatalerror.tobewritten.message.idofthelastscheduledthread = tid; + snprintf(s_eo_thefatalerror.tobewritten.message.forfutureuse, sizeof(s_eo_thefatalerror.tobewritten.message.forfutureuse), "%s", thrname); + s_eo_thefatalerror.tobewritten.message.signature = fatal_error_signature; +} + +static void s_info_standard(EOtheFatalError *p) +{ + // it is of the correct size. i use it to send a diagnostic message + uint16_t par16 = 0; + uint64_t par64 = p->detectedfatalerror.params.par64; + + p->errdes.code = eoerror_code_get(eoerror_category_Debug, eoerror_value_DEB_tag00); + p->errdes.sourcedevice = eo_errman_sourcedevice_localboard; + p->errdes.sourceaddress = 0; + p->errdes.par16 = par16; + p->errdes.par64 = par64; + eo_errman_Error(eo_errman_GetHandle(), eo_errortype_error, "RESTARTED after FATAL error", s_eobj_ownname, &p->errdes); + + // further information is in here + char str[64] = {0}; + + snprintf(str, sizeof(str), "@ %d ms", + p->detectedfatalerror.message.millisecondsfromstart + ); + eo_errman_Error(eo_errman_GetHandle(), eo_errortype_error, str, s_eobj_ownname, &p->errdes); + + snprintf(str, sizeof(str), "handler %s, code 0x%x", + s_fatalerror2string(p->detectedfatalerror.message.handlertype), + p->detectedfatalerror.message.handlererrorcode + ); + eo_errman_Error(eo_errman_GetHandle(), eo_errortype_error, str, s_eobj_ownname, &p->errdes); + + + snprintf(str, sizeof(str), "type %s", + s_get_fatalerrorstring(p->detectedfatalerror.message.handlertype, p->detectedfatalerror.message.handlererrorcode) + ); + eo_errman_Error(eo_errman_GetHandle(), eo_errortype_error, str, s_eobj_ownname, &p->errdes); + + + + osal_task_id_t tid = p->detectedfatalerror.message.idofthelastscheduledthread; + uint8_t ipsr = p->detectedfatalerror.message.ipsr; + const char * nameofthread = s_get_threadstring(p->detectedfatalerror.message.forfutureuse, tid); + const char * nameofirqhan = s_get_irqhandlerstring(ipsr); + + snprintf(str, sizeof(str), "IRQHan %s Thread %s", + nameofirqhan, + nameofthread + ); + eo_errman_Error(eo_errman_GetHandle(), eo_errortype_error, str, s_eobj_ownname, &p->errdes); + + snprintf(str, sizeof(str), "ipsr %d, tid %d", + ipsr, + tid + ); + eo_errman_Error(eo_errman_GetHandle(), eo_errortype_error, str, s_eobj_ownname, &p->errdes); +} + +static void s_save_hardfault(fatal_error_descriptor_t *des) +{ +// s_save_standard(des); + osal_task_id_t tid = 0; + const char *thrname = s_get_threadinfo(des, &tid); + + s_eo_thefatalerror.tobewritten.message.millisecondsfromstart = s_getmillitime(); + s_eo_thefatalerror.tobewritten.message.handlertype = des->handlertype; + s_eo_thefatalerror.tobewritten.message.handlererrorcode = 0; // 1 B + s_eo_thefatalerror.tobewritten.message.ipsr = hal_sys_get_IPSR(); + s_eo_thefatalerror.tobewritten.message.idofthelastscheduledthread = tid; + + + volatile uint32_t CFSR = *(volatile uint32_t *) 0xE000ED28; + + s_eo_thefatalerror.tobewritten.message.forfutureuse[0] = CFSR & 0xff; + s_eo_thefatalerror.tobewritten.message.forfutureuse[1] = (CFSR >> 8) & 0xff; + s_eo_thefatalerror.tobewritten.message.forfutureuse[2] = (CFSR >> 16) & 0xff; + s_eo_thefatalerror.tobewritten.message.forfutureuse[3] = (CFSR >> 24) & 0xff; + + //volatile uint32_t HFSR = *(volatile uint32_t *) 0xE000ED2C; + + s_eo_thefatalerror.tobewritten.message.signature = fatal_error_signature; +} + +static void s_info_hardfault(EOtheFatalError *p) +{ + // it is of the correct size. i use it to send a diagnostic message + uint16_t par16 = 0; + uint64_t par64 = p->detectedfatalerror.params.par64; + + p->errdes.code = eoerror_code_get(eoerror_category_Debug, eoerror_value_DEB_tag00); + p->errdes.sourcedevice = eo_errman_sourcedevice_localboard; + p->errdes.sourceaddress = 0; + p->errdes.par16 = par16; + p->errdes.par64 = par64; + eo_errman_Error(eo_errman_GetHandle(), eo_errortype_error, "RESTARTED after FATAL error", s_eobj_ownname, &p->errdes); + + // further information is in here + char str[64] = {0}; + + snprintf(str, sizeof(str), "@ %d ms", + p->detectedfatalerror.message.millisecondsfromstart + ); + eo_errman_Error(eo_errman_GetHandle(), eo_errortype_error, str, s_eobj_ownname, &p->errdes); + + snprintf(str, sizeof(str), "handler %s, code 0x%x", + s_fatalerror2string(p->detectedfatalerror.message.handlertype), + p->detectedfatalerror.message.handlererrorcode + ); + eo_errman_Error(eo_errman_GetHandle(), eo_errortype_error, str, s_eobj_ownname, &p->errdes); + + + snprintf(str, sizeof(str), "type %s", + s_get_fatalerrorstring(p->detectedfatalerror.message.handlertype, p->detectedfatalerror.message.handlererrorcode) + ); + eo_errman_Error(eo_errman_GetHandle(), eo_errortype_error, str, s_eobj_ownname, &p->errdes); + + osal_task_id_t tid = p->detectedfatalerror.message.idofthelastscheduledthread; + uint8_t ipsr = p->detectedfatalerror.message.ipsr; + const char * nameofthread = s_tid_to_threadname(tid); + const char * nameofirqhan = s_get_irqhandlerstring(ipsr); + + snprintf(str, sizeof(str), "IRQHan %s Thread %s", + nameofirqhan, + nameofthread + ); + eo_errman_Error(eo_errman_GetHandle(), eo_errortype_error, str, s_eobj_ownname, &p->errdes); + + + snprintf(str, sizeof(str), "ipsr %d, tid %d", + ipsr, + tid + ); + eo_errman_Error(eo_errman_GetHandle(), eo_errortype_error, str, s_eobj_ownname, &p->errdes); + + uint32_t CFSR = ((uint32_t)(p->detectedfatalerror.message.forfutureuse[0]) ) | + ((uint32_t)(p->detectedfatalerror.message.forfutureuse[1]) << 8 ) | + ((uint32_t)(p->detectedfatalerror.message.forfutureuse[2]) << 16 ) | + ((uint32_t)(p->detectedfatalerror.message.forfutureuse[3]) << 24 ) ; + snprintf(str, sizeof(str), "CFSR 0x%x", + CFSR + ); + eo_errman_Error(eo_errman_GetHandle(), eo_errortype_error, str, s_eobj_ownname, &p->errdes); +} + + +// error tests + +#if !defined(EOTHEFATALERROR_ACTIVATE_TEST) + +static void s_test(fatal_error_descriptor_t *des) +{ +} + +#else + +//#define USE_CBKMANAGER +#define USE_DELAY + +//#define USE_IRQ_HANDLER_RTC_ALARM +//#define USE_HALERROR +//#define USE_OSALERROR +//#define USE_BIGMALLOC +//#define USE_BIGSTACK +//#define USE_DIVIDEBYZERO +#define USE_NULLPTR + +#include "EOtimer.h" +#include "EOVtheCallbackManager.h" +#include "EOtheMemoryPool.h" + +extern void RTC_Alarm_IRQHandler(); +extern const hal_core_cfg_t hal_cfg; +extern const osal_cfg_t osal_cfg; + +uint32_t useme(uint32_t n) +{ + volatile uint64_t buffer[2000] = {0}; + + for(int i = 0; i<2000; i++) + { + buffer[i] = 666; + } + + return n; +} + +void callback(void* par) +{ +#if defined(USE_IRQ_HANDLER_RTC_ALARM) + RTC_Alarm_IRQHandler(); +#elif defined(USE_HALERROR) + hal_cfg.basecfg.extfn.usr_on_fatal_error(hal_fatalerror_runtimefault, "hal"); +#elif defined(USE_OSALERROR) + osal_cfg.extfn.usr_on_fatal_error(NULL, osal_error_stackoverflow, "osal"); +#elif defined(USE_BIGMALLOC) + uint8_t *p = eo_mempool_GetMemory(eo_mempool_GetHandle(), eo_mempool_align_32bit, 10000, 1); + par = p; +#elif defined(USE_BIGSTACK) + static volatile uint32_t me = 1000; + me++; + useme(me); + osal_task_id_t tid = 0; + osal_task_t * osalt = osal_task_get(osal_callerAUTOdetect); + osal_task_id_get(osalt, &tid); + +#elif defined(USE_DIVIDEBYZERO) + + static volatile uint32_t res = 32; + static volatile uint32_t div = 0; + volatile uint32_t re = 0; + re = res / div; + re = res; + +#elif defined(USE_NULLPTR) + + EOtheFatalError *pp = NULL; + for(int i=0; i<2000; i++) + { + + { + memcpy(pp->threads[i].nameof, "CIIIIIIIIIIIIIIIIIIIIIIII", 50); + } + } + +#endif +} + +void *cbkpar = NULL; + +EOtimer *s_timer = NULL; + +static EOaction_strg s_astrg = {0}; +static EOaction *s_act = (EOaction*)&s_astrg; + +static const eOreltime_t s_delay = 10*EOK_reltime1sec; + +static volatile eOabstime_t s_after = 20*EOK_reltime1sec; + +static void s_test(fatal_error_descriptor_t *des) +{ +#if defined(USE_CBKMANAGER) + if(NULL == s_timer) + { + s_timer = eo_timer_New(); + } + eo_action_SetCallback(s_act, callback, cbkpar, eov_callbackman_GetTask(eov_callbackman_GetHandle())); + eo_timer_Start(s_timer, eok_abstimeNOW, s_delay, eo_tmrmode_ONESHOT, s_act); +#elif defined(USE_DELAY) + + volatile eOabstime_t now = osal_system_abstime_get(); + if(now > s_after) + { + callback(NULL); + } + +#endif +} + +#endif + +// -------------------------------------------------------------------------------------------------------------------- +// - end-of-file (leave a blank line after) +// -------------------------------------------------------------------------------------------------------------------- + diff --git a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOtheFatalError.h b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOtheFatalError.h new file mode 100644 index 000000000..fbb1b09d5 --- /dev/null +++ b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOtheFatalError.h @@ -0,0 +1,93 @@ + +/* + * Copyright (C) 2021 iCub Tech - Istituto Italiano di Tecnologia + * Author: Marco Accame + * email: marco.accame@iit.it +*/ + + + +// - include guard ---------------------------------------------------------------------------------------------------- +#ifndef __EOTHEFATALERROR_H_ +#define __EOTHEFATALERROR_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + + +// - external dependencies -------------------------------------------------------------------------------------------- + +#include "EoCommon.h" + + + + +// - public #define -------------------------------------------------------------------------------------------------- +// empty-section + + +// - declaration of public user-defined types ------------------------------------------------------------------------- + +typedef struct EOtheFatalError_hid EOtheFatalError; + +typedef enum +{ + fatalerror_handler_none = 0, + fatalerrr_handler_unknown = 1, + fatalerror_handler_hal = 2, + fatalerror_handler_osal = 3, + fatalerror_handler_ipal = 4, + fatalerror_handler_hw_NMI = 5, + fatalerror_handler_hw_HardFault = 6, + fatalerror_handler_hw_MemManage = 7, + fatalerror_handler_hw_BusFault = 8, + fatalerror_handler_hw_UsageFault = 9, + fatalerror_handler_hw_DebugMon = 10, + fatalerror_handler_hw_Default = 11 +} fatal_error_handler_t; + +enum { fatal_error_handler_numbersof = 12 }; + +typedef struct +{ + uint8_t handlertype; // use values from fatal_error_handler_t + uint8_t handlererrorcode; + uint8_t forfutureuse0; + uint8_t forfutureuse1; + void *param; +} fatal_error_descriptor_t; + + + +// - declaration of extern public variables, ...deprecated: better using use _get/_set instead ------------------------ +// empty-section + +// - declaration of extern public functions --------------------------------------------------------------------------- + + +extern EOtheFatalError* eo_fatalerror_Initialise(void); + +extern EOtheFatalError* eo_fatalerror_GetHandle(void); + +extern void eo_fatalerror_AtStartup(EOtheFatalError *p); + +extern fatal_error_descriptor_t * eo_fatalerror_GetDescriptor(EOtheFatalError *p); + +extern void eo_fatalerror_Restart(EOtheFatalError *p, fatal_error_descriptor_t *des); + +extern void eo_fatalerror_Test(EOtheFatalError *p, fatal_error_descriptor_t *des); + +extern void eo_fatalerror_RegisterThread(EOtheFatalError *p, void *t, const char *n); + + +#ifdef __cplusplus +} // closing brace for extern "C" +#endif + +#endif // include-guard + +// - end-of-file (leave a blank line after)---------------------------------------------------------------------------- + + diff --git a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOtheFatalError_hid.h b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOtheFatalError_hid.h new file mode 100644 index 000000000..bb50d5efd --- /dev/null +++ b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOtheFatalError_hid.h @@ -0,0 +1,104 @@ + + +/* + * Copyright (C) 2021 iCub Tech - Istituto Italiano di Tecnologia + * Author: Marco Accame + * email: marco.accame@iit.it +*/ + + +// - include guard ---------------------------------------------------------------------------------------------------- + +#ifndef __EOTHEFATALERROR_HID_H_ +#define __EOTHEFATALERROR_HID_H_ + + +#ifdef __cplusplus +extern "C" { +#endif + +// - external dependencies -------------------------------------------------------------------------------------------- + +#include "EoCommon.h" + +#include "eEsharedServices.h" + +#include "EOtheErrorManager.h" + +#include "osal.h" + +// - declaration of extern public interface --------------------------------------------------------------------------- + +#include "EOtheFatalError.h" + + + +// - macros which enable/disable the code for the services ------------------------------------------------------------ + +// - definition of the hidden struct implementing the object ---------------------------------------------------------- + +enum { fatal_error_signature = 0x66 }; + +typedef struct +{ + uint32_t millisecondsfromstart; + uint8_t handlertype; + uint8_t handlererrorcode; + uint8_t ipsr; + uint8_t idofthelastscheduledthread; + char forfutureuse[6]; + uint8_t signature; // it must be fatal_error_signature + uint8_t notusable; +} fatal_error_message_t; EO_VERIFYsizeof(fatal_error_message_t, 16) + + +typedef struct +{ + uint64_t par64; + uint16_t par16; +} fatal_error_params_t; EO_VERIFYsizeof(fatal_error_params_t, 16) + +typedef union +{ + fatal_error_message_t message; + fatal_error_params_t params; +} fatal_error_t; EO_VERIFYsizeof(fatal_error_t, 16) + + +enum { threadnameofsize = 15 }; +typedef struct +{ +// osal_task_t *t; + osal_task_id_t tid; + char nameof[threadnameofsize]; +} threadinfo_t; + +enum { maxthreads = 16 }; + + +struct EOtheFatalError_hid +{ + eObool_t initted; + uint8_t threadcount; + fatal_error_descriptor_t descriptor; + fatal_error_t tobewritten; + fatal_error_t detectedfatalerror; + eOerrmanDescriptor_t errdes; + threadinfo_t threads[maxthreads]; +}; + + +// - declaration of extern hidden functions --------------------------------------------------------------------------- + + + +#ifdef __cplusplus +} // closing brace for extern "C" +#endif + +#endif // include-guard + +// - end-of-file (leave a blank line after)---------------------------------------------------------------------------- + + + diff --git a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOthePOS.c b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOthePOS.c index 5ccee83f0..8108a61a4 100644 --- a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOthePOS.c +++ b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOthePOS.c @@ -29,6 +29,8 @@ #include "EOVtheCallbackManager.h" +//#include "EOtheFatalError.h" + // -------------------------------------------------------------------------------------------------------------------- // - declaration of extern public interface // -------------------------------------------------------------------------------------------------------------------- @@ -252,63 +254,7 @@ static EOthePOS s_eo_thepos = static const char s_eobj_ownname[] = "EOthePOS"; -const eOmn_serv_config_data_as_pos_t eo_pos_servconf_data_as_pos = -{ - .version = - { - .firmware = - { - .major = 1, .minor = 1, .build = 0 - }, - .protocol = - { - .major = 1, .minor = 1 - } - }, - .boardInfo = - { - .canloc = - { - { - .port = eOcanport1, - .addr = 1, - .insideindex = eobrd_caninsideindex_none - } - } - } -}; -const eOmn_serv_configuration_t eo_pos_servconf = -{ - .type = eomn_serv_AS_pos, - .filler = {0}, - .data.as.pos = - { - .version = - { - .firmware = - { - .major = 1, .minor = 1, .build = 0 - }, - .protocol = - { - .major = 1, .minor = 1 - } - }, - .boardInfo = - { - .canloc = - { - { - .port = eOcanport1, - .addr = 1, - .insideindex = eobrd_caninsideindex_none - } - } - } - - } -}; #define REM_WDT @@ -774,7 +720,9 @@ extern eOresult_t eo_pos_Transmission(EOthePOS *p, eObool_t on) extern eOresult_t eo_pos_Tick(EOthePOS *p) -{ +{ + // eo_fatalerror_Test(eo_fatalerror_GetHandle(), NULL); + if(NULL == p) { return(eores_NOK_nullpointer); diff --git a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOtheServices.c b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOtheServices.c index b126bae27..0b125c525 100644 --- a/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOtheServices.c +++ b/emBODY/eBcode/arch-arm/board/ems004/appl/v2/src/eoappservices/EOtheServices.c @@ -61,6 +61,8 @@ #include "EOtheMemoryPool.h" +#include "EOtheFatalError.h" + // -------------------------------------------------------------------------------------------------------------------- // - declaration of extern public interface // -------------------------------------------------------------------------------------------------------------------- @@ -614,6 +616,17 @@ static void s_eo_services_initialise(EOtheServices *p) } // A. + + + { // A.1 evaluate if there was a restart due to fatal errors + + eo_fatalerror_Initialise(); + eo_fatalerror_AtStartup(eo_fatalerror_GetHandle()); + + // eo_fatalerror_Test(eo_fatalerror_GetHandle(), NULL); + + } + { // B. the entities: only initted but not started or activated yets eo_entities_Initialise(); diff --git a/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/abslayer/hal_core_cfg.c b/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/abslayer/hal_core_cfg.c index 1caa4c471..6648c36b8 100644 --- a/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/abslayer/hal_core_cfg.c +++ b/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/abslayer/hal_core_cfg.c @@ -27,12 +27,16 @@ // - external dependencies // -------------------------------------------------------------------------------------------------------------------- -#include "stdlib.h" -#include "hal_core.h" - -#include "EOtheErrorManager.h" -#include "EoError.h" +#undef DONTUSE_EOtheFatalError +#if !defined(DONTUSE_EOtheFatalError) + #include "EOtheFatalError.h" +#else + #include "EOtheErrorManager.h" + #include "EoError.h" + #include "hal_trace.h" + #include "hal_led.h" +#endif // -------------------------------------------------------------------------------------------------------------------- // - declaration of extern public interface @@ -85,6 +89,15 @@ const hal_core_cfg_t *hal_coreCFGptr = &hal_cfg; static void s_hal_core_cfg_on_fatalerror(hal_fatalerror_t errorcode, const char * errormsg) { +#if !defined(DONTUSE_EOtheFatalError) + // in here there is just a test of emission of ipc data w/ a restart + fatal_error_descriptor_t *des = eo_fatalerror_GetDescriptor(eo_fatalerror_GetHandle()); + des->handlertype = fatalerror_handler_hal; + des->handlererrorcode = errorcode; + des->param = NULL; + eo_fatalerror_Restart(eo_fatalerror_GetHandle(), des); +#else + #warning DONTUSE_EOtheFatalError is defined, are you sure? if(eobool_true == eo_errman_IsErrorHandlerConfigured(eo_errman_GetHandle())) { // ok ... use the error manager, either in its simple form or in its networked form @@ -135,6 +148,7 @@ static void s_hal_core_cfg_on_fatalerror(hal_fatalerror_t errorcode, const char hal_led_toggle(hal_led5); } } +#endif } #include "osal_base.h" @@ -148,7 +162,60 @@ static void myheap_delete(void* mem) osal_base_memory_del(mem); } +#if !defined(DONTUSE_EOtheFatalError) + +void hw_handler(fatal_error_handler_t feh) +{ + fatal_error_descriptor_t *des = eo_fatalerror_GetDescriptor(eo_fatalerror_GetHandle()); + des->handlertype = feh; + des->handlererrorcode = 100; + des->forfutureuse0 = 0x12; + des->forfutureuse1 = 0x23; + des->param = NULL; + eo_fatalerror_Restart(eo_fatalerror_GetHandle(), des); +} + +void NMI_Handler(void) +{ + hw_handler(fatalerror_handler_hw_NMI); +} + +void HardFault_Handler(void) +{ + hw_handler(fatalerror_handler_hw_HardFault); +} + +void MemManage_Handler(void) +{ + hw_handler(fatalerror_handler_hw_MemManage); +} + +void BusFault_Handler(void) +{ + hw_handler(fatalerror_handler_hw_BusFault); +} + +void UsageFault_Handler(void) +{ + hw_handler(fatalerror_handler_hw_UsageFault); +} + +void DebugMon_Handler(void) +{ + hw_handler(fatalerror_handler_hw_DebugMon); +} + +void Default_Handler(void) +{ + hw_handler(fatalerror_handler_hw_Default); +} + +void RTC_Alarm_IRQHandler(void) +{ + hw_handler(fatalerror_handler_hw_Default); +} +#endif // -------------------------------------------------------------------------------------------------------------------- diff --git a/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/abslayer/ipal_cfg.c b/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/abslayer/ipal_cfg.c index 3af960ea6..302fbc275 100644 --- a/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/abslayer/ipal_cfg.c +++ b/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/abslayer/ipal_cfg.c @@ -27,13 +27,19 @@ // - external dependencies // -------------------------------------------------------------------------------------------------------------------- -#include "EOtheErrorManager.h" -#include "EoError.h" +#undef DONTUSE_EOtheFatalError - -#include "ipal.h" +#if !defined(DONTUSE_EOtheFatalError) + #include "EOtheFatalError.h" +#else + #include "EOtheErrorManager.h" + #include "EoError.h" + #include "hal_trace.h" + #include "hal_led.h" +#endif +#include "ipal.h" #include "hal.h" #include "osal.h" @@ -169,7 +175,14 @@ static void onethframerx(void) static void s_ipal_cfg_on_fatal_error(ipal_fatalerror_t errorcode, const char * errormsg) { - +#if !defined(DONTUSE_EOtheFatalError) + fatal_error_descriptor_t *des = eo_fatalerror_GetDescriptor(eo_fatalerror_GetHandle()); + des->handlertype = fatalerror_handler_ipal; + des->handlererrorcode = errorcode; + des->param = NULL; + eo_fatalerror_Restart(eo_fatalerror_GetHandle(), des); +#else + #warning DONTUSE_EOtheFatalError is defined, are you sure? char str[256]; if(eobool_true == eo_errman_IsErrorHandlerConfigured(eo_errman_GetHandle())) @@ -218,6 +231,7 @@ static void s_ipal_cfg_on_fatal_error(ipal_fatalerror_t errorcode, const char * hal_led_toggle(hal_led5); } } +#endif } diff --git a/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/abslayer/osal_cfg.c b/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/abslayer/osal_cfg.c index 6f7d02f64..d386ef236 100644 --- a/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/abslayer/osal_cfg.c +++ b/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/abslayer/osal_cfg.c @@ -27,20 +27,21 @@ // - external dependencies // -------------------------------------------------------------------------------------------------------------------- -#include "stdio.h" -#include "string.h" -#include "osal.h" -#include "osal_arch_arm.h" -#include "hal_trace.h" -#include "stdlib.h" +#undef DONTUSE_EOtheFatalError -#include "hal_led.h" -#include "hal_sys.h" +#if !defined(DONTUSE_EOtheFatalError) + #include "EOtheFatalError.h" +#else + #include "EOtheErrorManager.h" + #include "EoError.h" + #include "hal_trace.h" + #include "hal_sys.h" + #include "hal_led.h" +#endif -#include "EOtheErrorManager.h" -#include "EoError.h" -#include "embOBJporting.h" +#include "osal.h" +#include "osal_arch_arm.h" // -------------------------------------------------------------------------------------------------------------------- // - declaration of extern public interface @@ -112,6 +113,14 @@ const osal_cfg_t *osal_cfgMINEX = &osal_cfg; static void s_osal_cfg_on_fatal_error(void* task, osal_fatalerror_t errorcode, const char * errormsg) { +#if !defined(DONTUSE_EOtheFatalError) + fatal_error_descriptor_t *des = eo_fatalerror_GetDescriptor(eo_fatalerror_GetHandle()); + des->handlertype = fatalerror_handler_osal; + des->handlererrorcode = errorcode; + des->param = task; + eo_fatalerror_Restart(eo_fatalerror_GetHandle(), des); +#else + #warning DONTUSE_EOtheFatalError is defined, are you sure? uint8_t tskid = 0; char str[64]; osal_task_id_get((osal_task_t*)task, &tskid); @@ -163,7 +172,7 @@ static void s_osal_cfg_on_fatal_error(void* task, osal_fatalerror_t errorcode, c hal_led_toggle(hal_led5); } } - +#endif } static void s_osal_cfg_on_idle(void) diff --git a/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/eoemsappl/EOMtheEMSapplCfg_cfg.h b/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/eoemsappl/EOMtheEMSapplCfg_cfg.h index ddc15793c..ff03f92ea 100644 --- a/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/eoemsappl/EOMtheEMSapplCfg_cfg.h +++ b/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/cfg/eoemsappl/EOMtheEMSapplCfg_cfg.h @@ -75,7 +75,7 @@ extern "C" { #define EOMTHEEMSAPPLCFG_VERSION_MAJOR 3 // minor <0-255> // minor <0-255> -#define EOMTHEEMSAPPLCFG_VERSION_MINOR 25 +#define EOMTHEEMSAPPLCFG_VERSION_MINOR 26 // version // build date @@ -84,11 +84,11 @@ extern "C" { // month <1-12> #define EOMTHEEMSAPPLCFG_BUILDDATE_MONTH 6 // day <1-31> -#define EOMTHEEMSAPPLCFG_BUILDDATE_DAY 10 +#define EOMTHEEMSAPPLCFG_BUILDDATE_DAY 22 // hour <0-23> -#define EOMTHEEMSAPPLCFG_BUILDDATE_HOUR 14 +#define EOMTHEEMSAPPLCFG_BUILDDATE_HOUR 11 // minute <0-59> -#define EOMTHEEMSAPPLCFG_BUILDDATE_MIN 13 +#define EOMTHEEMSAPPLCFG_BUILDDATE_MIN 48 // build date // Info diff --git a/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/proj/mc2plus.diagnostic2ready.uvoptx b/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/proj/mc2plus.diagnostic2ready.uvoptx index ed28c2e12..30d36e975 100644 --- a/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/proj/mc2plus.diagnostic2ready.uvoptx +++ b/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/proj/mc2plus.diagnostic2ready.uvoptx @@ -2148,6 +2148,18 @@ 0 0 + + 12 + 95 + 1 + 0 + 0 + 0 + ..\..\..\..\ems004\appl\v2\src\eoappservices\EOtheFatalError.c + EOtheFatalError.c + 0 + 0 + @@ -2158,7 +2170,7 @@ 0 13 - 95 + 96 1 0 0 @@ -2170,7 +2182,7 @@ 13 - 96 + 97 1 0 0 @@ -2182,7 +2194,7 @@ 13 - 97 + 98 1 0 0 @@ -2194,7 +2206,7 @@ 13 - 98 + 99 1 0 0 @@ -2206,7 +2218,7 @@ 13 - 99 + 100 1 0 0 @@ -2218,7 +2230,7 @@ 13 - 100 + 101 1 0 0 @@ -2230,7 +2242,7 @@ 13 - 101 + 102 1 0 0 @@ -2242,7 +2254,7 @@ 13 - 102 + 103 1 0 0 @@ -2254,7 +2266,7 @@ 13 - 103 + 104 1 0 0 @@ -2274,7 +2286,7 @@ 0 14 - 104 + 105 1 0 0 @@ -2286,7 +2298,7 @@ 14 - 105 + 106 1 0 0 @@ -2298,7 +2310,7 @@ 14 - 106 + 107 1 0 0 @@ -2310,7 +2322,7 @@ 14 - 107 + 108 1 0 0 @@ -2322,7 +2334,7 @@ 14 - 108 + 109 1 0 0 @@ -2334,7 +2346,7 @@ 14 - 109 + 110 1 0 0 @@ -2346,7 +2358,7 @@ 14 - 110 + 111 1 0 0 @@ -2358,7 +2370,7 @@ 14 - 111 + 112 1 0 0 @@ -2370,7 +2382,7 @@ 14 - 112 + 113 1 0 0 @@ -2382,7 +2394,7 @@ 14 - 113 + 114 1 0 0 @@ -2394,7 +2406,7 @@ 14 - 114 + 115 1 0 0 @@ -2406,7 +2418,7 @@ 14 - 115 + 116 1 0 0 @@ -2418,7 +2430,7 @@ 14 - 116 + 117 1 0 0 @@ -2430,7 +2442,7 @@ 14 - 117 + 118 1 0 0 @@ -2442,7 +2454,7 @@ 14 - 118 + 119 1 0 0 @@ -2462,7 +2474,7 @@ 0 15 - 119 + 120 1 0 0 @@ -2474,7 +2486,7 @@ 15 - 120 + 121 1 0 0 @@ -2486,7 +2498,7 @@ 15 - 121 + 122 1 0 0 @@ -2498,7 +2510,7 @@ 15 - 122 + 123 1 0 0 @@ -2510,7 +2522,7 @@ 15 - 123 + 124 1 0 0 @@ -2522,7 +2534,7 @@ 15 - 124 + 125 1 0 0 @@ -2534,7 +2546,7 @@ 15 - 125 + 126 1 0 0 @@ -2546,7 +2558,7 @@ 15 - 126 + 127 1 0 0 @@ -2558,7 +2570,7 @@ 15 - 127 + 128 1 0 0 @@ -2570,7 +2582,7 @@ 15 - 128 + 129 1 0 0 @@ -2582,7 +2594,7 @@ 15 - 129 + 130 1 0 0 @@ -2594,7 +2606,7 @@ 15 - 130 + 131 1 0 0 @@ -2606,7 +2618,7 @@ 15 - 131 + 132 1 0 0 @@ -2618,7 +2630,7 @@ 15 - 132 + 133 1 0 0 @@ -2630,7 +2642,7 @@ 15 - 133 + 134 1 0 0 @@ -2642,7 +2654,7 @@ 15 - 134 + 135 1 0 0 @@ -2662,7 +2674,7 @@ 0 16 - 135 + 136 1 0 0 @@ -2674,7 +2686,7 @@ 16 - 136 + 137 1 0 0 @@ -2686,7 +2698,7 @@ 16 - 137 + 138 1 0 0 @@ -2698,7 +2710,7 @@ 16 - 138 + 139 1 0 0 @@ -2718,7 +2730,7 @@ 0 17 - 139 + 140 1 0 0 @@ -2730,7 +2742,7 @@ 17 - 140 + 141 1 0 0 @@ -2742,7 +2754,7 @@ 17 - 141 + 142 1 0 0 @@ -2762,7 +2774,7 @@ 0 18 - 142 + 143 1 0 0 @@ -2774,7 +2786,7 @@ 18 - 143 + 144 1 0 0 @@ -2786,7 +2798,7 @@ 18 - 144 + 145 1 0 0 @@ -2798,7 +2810,7 @@ 18 - 145 + 146 1 0 0 @@ -2810,7 +2822,7 @@ 18 - 146 + 147 1 0 0 @@ -2822,7 +2834,7 @@ 18 - 147 + 148 1 0 0 @@ -2842,7 +2854,7 @@ 0 19 - 148 + 149 8 0 0 @@ -2854,7 +2866,7 @@ 19 - 149 + 150 8 0 0 @@ -2866,7 +2878,7 @@ 19 - 150 + 151 8 0 0 @@ -2878,7 +2890,7 @@ 19 - 151 + 152 8 0 0 @@ -2898,7 +2910,7 @@ 0 20 - 152 + 153 8 0 0 @@ -2910,7 +2922,7 @@ 20 - 153 + 154 8 0 0 @@ -2922,7 +2934,7 @@ 20 - 154 + 155 8 0 0 @@ -2934,7 +2946,7 @@ 20 - 155 + 156 8 0 0 @@ -2946,7 +2958,7 @@ 20 - 156 + 157 8 0 0 diff --git a/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/proj/mc2plus.diagnostic2ready.uvprojx b/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/proj/mc2plus.diagnostic2ready.uvprojx index bf799b926..61d600e67 100644 --- a/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/proj/mc2plus.diagnostic2ready.uvprojx +++ b/emBODY/eBcode/arch-arm/board/mc2plus/appl/v2/proj/mc2plus.diagnostic2ready.uvprojx @@ -10,7 +10,7 @@ mc2plus 0x4 ARM-ADS - 6150000::V6.15::ARMCLANG + 6160000::V6.16::ARMCLANG 1 @@ -908,6 +908,11 @@ 1 ..\..\..\..\ems004\appl\v2\src\eoappservices\EOthePOS.c + + EOtheFatalError.c + 1 + ..\..\..\..\ems004\appl\v2\src\eoappservices\EOtheFatalError.c + @@ -2232,6 +2237,11 @@ 1 ..\..\..\..\ems004\appl\v2\src\eoappservices\EOthePOS.c + + EOtheFatalError.c + 1 + ..\..\..\..\ems004\appl\v2\src\eoappservices\EOtheFatalError.c + diff --git a/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/abslayer/hal_core_cfg.c b/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/abslayer/hal_core_cfg.c index 1caa4c471..aeea1d3fa 100644 --- a/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/abslayer/hal_core_cfg.c +++ b/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/abslayer/hal_core_cfg.c @@ -27,12 +27,16 @@ // - external dependencies // -------------------------------------------------------------------------------------------------------------------- -#include "stdlib.h" -#include "hal_core.h" - -#include "EOtheErrorManager.h" -#include "EoError.h" +#undef DONTUSE_EOtheFatalError +#if !defined(DONTUSE_EOtheFatalError) + #include "EOtheFatalError.h" +#else + #include "EOtheErrorManager.h" + #include "EoError.h" + #include "hal_trace.h" + #include "hal_led.h" +#endif // -------------------------------------------------------------------------------------------------------------------- // - declaration of extern public interface @@ -80,11 +84,17 @@ const hal_core_cfg_t hal_cfg = const hal_core_cfg_t *hal_coreCFGptr = &hal_cfg; -#include "hal_trace.h" -#include "hal_led.h" - static void s_hal_core_cfg_on_fatalerror(hal_fatalerror_t errorcode, const char * errormsg) { +#if !defined(DONTUSE_EOtheFatalError) + // in here there is just a test of emission of ipc data w/ a restart + fatal_error_descriptor_t *des = eo_fatalerror_GetDescriptor(eo_fatalerror_GetHandle()); + des->handlertype = fatalerror_handler_hal; + des->handlererrorcode = errorcode; + des->param = NULL; + eo_fatalerror_Restart(eo_fatalerror_GetHandle(), des); +#else + #warning DONTUSE_EOtheFatalError is defined, are you sure? if(eobool_true == eo_errman_IsErrorHandlerConfigured(eo_errman_GetHandle())) { // ok ... use the error manager, either in its simple form or in its networked form @@ -135,6 +145,7 @@ static void s_hal_core_cfg_on_fatalerror(hal_fatalerror_t errorcode, const char hal_led_toggle(hal_led5); } } +#endif } #include "osal_base.h" @@ -143,13 +154,67 @@ static void* myheap_new(uint32_t size) { return(osal_base_memory_new(size)); } + static void myheap_delete(void* mem) { osal_base_memory_del(mem); } +#if !defined(DONTUSE_EOtheFatalError) + +void hw_handler(fatal_error_handler_t feh) +{ + fatal_error_descriptor_t *des = eo_fatalerror_GetDescriptor(eo_fatalerror_GetHandle()); + des->handlertype = feh; + des->handlererrorcode = 100; + des->forfutureuse0 = 0x12; + des->forfutureuse1 = 0x23; + des->param = NULL; + eo_fatalerror_Restart(eo_fatalerror_GetHandle(), des); +} + +void NMI_Handler(void) +{ + hw_handler(fatalerror_handler_hw_NMI); +} + +void HardFault_Handler(void) +{ + hw_handler(fatalerror_handler_hw_HardFault); +} + +void MemManage_Handler(void) +{ + hw_handler(fatalerror_handler_hw_MemManage); +} + +void BusFault_Handler(void) +{ + hw_handler(fatalerror_handler_hw_BusFault); +} + +void UsageFault_Handler(void) +{ + hw_handler(fatalerror_handler_hw_UsageFault); +} + +void DebugMon_Handler(void) +{ + hw_handler(fatalerror_handler_hw_DebugMon); +} + +void Default_Handler(void) +{ + hw_handler(fatalerror_handler_hw_Default); +} + +void RTC_Alarm_IRQHandler(void) +{ + hw_handler(fatalerror_handler_hw_Default); +} +#endif // -------------------------------------------------------------------------------------------------------------------- // - end-of-file (leave a blank line after) diff --git a/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/abslayer/ipal_cfg.c b/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/abslayer/ipal_cfg.c index 3af960ea6..7edff0a14 100644 --- a/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/abslayer/ipal_cfg.c +++ b/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/abslayer/ipal_cfg.c @@ -27,17 +27,22 @@ // - external dependencies // -------------------------------------------------------------------------------------------------------------------- -#include "EOtheErrorManager.h" -#include "EoError.h" +#undef DONTUSE_EOtheFatalError - -#include "ipal.h" +#if !defined(DONTUSE_EOtheFatalError) + #include "EOtheFatalError.h" +#else + #include "EOtheErrorManager.h" + #include "EoError.h" + #include "hal_trace.h" + #include "hal_led.h" +#endif +#include "ipal.h" #include "hal.h" #include "osal.h" - // -------------------------------------------------------------------------------------------------------------------- // - declaration of extern public interface // -------------------------------------------------------------------------------------------------------------------- @@ -169,7 +174,14 @@ static void onethframerx(void) static void s_ipal_cfg_on_fatal_error(ipal_fatalerror_t errorcode, const char * errormsg) { - +#if !defined(DONTUSE_EOtheFatalError) + fatal_error_descriptor_t *des = eo_fatalerror_GetDescriptor(eo_fatalerror_GetHandle()); + des->handlertype = fatalerror_handler_ipal; + des->handlererrorcode = errorcode; + des->param = NULL; + eo_fatalerror_Restart(eo_fatalerror_GetHandle(), des); +#else + #warning DONTUSE_EOtheFatalError is defined, are you sure? char str[256]; if(eobool_true == eo_errman_IsErrorHandlerConfigured(eo_errman_GetHandle())) @@ -218,6 +230,7 @@ static void s_ipal_cfg_on_fatal_error(ipal_fatalerror_t errorcode, const char * hal_led_toggle(hal_led5); } } +#endif } diff --git a/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/abslayer/osal_cfg.c b/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/abslayer/osal_cfg.c index 6f7d02f64..d386ef236 100644 --- a/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/abslayer/osal_cfg.c +++ b/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/abslayer/osal_cfg.c @@ -27,20 +27,21 @@ // - external dependencies // -------------------------------------------------------------------------------------------------------------------- -#include "stdio.h" -#include "string.h" -#include "osal.h" -#include "osal_arch_arm.h" -#include "hal_trace.h" -#include "stdlib.h" +#undef DONTUSE_EOtheFatalError -#include "hal_led.h" -#include "hal_sys.h" +#if !defined(DONTUSE_EOtheFatalError) + #include "EOtheFatalError.h" +#else + #include "EOtheErrorManager.h" + #include "EoError.h" + #include "hal_trace.h" + #include "hal_sys.h" + #include "hal_led.h" +#endif -#include "EOtheErrorManager.h" -#include "EoError.h" -#include "embOBJporting.h" +#include "osal.h" +#include "osal_arch_arm.h" // -------------------------------------------------------------------------------------------------------------------- // - declaration of extern public interface @@ -112,6 +113,14 @@ const osal_cfg_t *osal_cfgMINEX = &osal_cfg; static void s_osal_cfg_on_fatal_error(void* task, osal_fatalerror_t errorcode, const char * errormsg) { +#if !defined(DONTUSE_EOtheFatalError) + fatal_error_descriptor_t *des = eo_fatalerror_GetDescriptor(eo_fatalerror_GetHandle()); + des->handlertype = fatalerror_handler_osal; + des->handlererrorcode = errorcode; + des->param = task; + eo_fatalerror_Restart(eo_fatalerror_GetHandle(), des); +#else + #warning DONTUSE_EOtheFatalError is defined, are you sure? uint8_t tskid = 0; char str[64]; osal_task_id_get((osal_task_t*)task, &tskid); @@ -163,7 +172,7 @@ static void s_osal_cfg_on_fatal_error(void* task, osal_fatalerror_t errorcode, c hal_led_toggle(hal_led5); } } - +#endif } static void s_osal_cfg_on_idle(void) diff --git a/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/eoemsappl/EOMtheEMSapplCfg_cfg.h b/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/eoemsappl/EOMtheEMSapplCfg_cfg.h index 14b68eea7..3ad530610 100644 --- a/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/eoemsappl/EOMtheEMSapplCfg_cfg.h +++ b/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/cfg/eoemsappl/EOMtheEMSapplCfg_cfg.h @@ -76,7 +76,7 @@ extern "C" { // minor <0-255> -#define EOMTHEEMSAPPLCFG_VERSION_MINOR 35 +#define EOMTHEEMSAPPLCFG_VERSION_MINOR 36 // version @@ -87,11 +87,11 @@ extern "C" { // month <1-12> #define EOMTHEEMSAPPLCFG_BUILDDATE_MONTH 6 // day <1-31> -#define EOMTHEEMSAPPLCFG_BUILDDATE_DAY 14 +#define EOMTHEEMSAPPLCFG_BUILDDATE_DAY 22 // hour <0-23> -#define EOMTHEEMSAPPLCFG_BUILDDATE_HOUR 17 +#define EOMTHEEMSAPPLCFG_BUILDDATE_HOUR 12 // minute <0-59> -#define EOMTHEEMSAPPLCFG_BUILDDATE_MIN 48 +#define EOMTHEEMSAPPLCFG_BUILDDATE_MIN 15 // build date diff --git a/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/proj/mc4plus.diagnostic2ready.uvoptx b/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/proj/mc4plus.diagnostic2ready.uvoptx index 47051dcb9..12037526f 100644 --- a/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/proj/mc4plus.diagnostic2ready.uvoptx +++ b/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/proj/mc4plus.diagnostic2ready.uvoptx @@ -503,7 +503,7 @@ main - 1 + 0 0 0 0 @@ -567,7 +567,7 @@ abslayer-cfg - 0 + 1 0 0 0 @@ -943,7 +943,7 @@ eo-core-mee - 0 + 1 0 0 0 @@ -1455,7 +1455,7 @@ appl-services - 1 + 0 0 0 0 @@ -1723,6 +1723,18 @@ 0 0 + + 12 + 95 + 1 + 0 + 0 + 0 + ..\..\..\..\ems004\appl\v2\src\eoappservices\EOtheFatalError.c + EOtheFatalError.c + 0 + 0 + @@ -1733,7 +1745,7 @@ 0 13 - 95 + 96 1 0 0 @@ -1745,7 +1757,7 @@ 13 - 96 + 97 1 0 0 @@ -1757,7 +1769,7 @@ 13 - 97 + 98 1 0 0 @@ -1769,7 +1781,7 @@ 13 - 98 + 99 1 0 0 @@ -1781,7 +1793,7 @@ 13 - 99 + 100 1 0 0 @@ -1793,7 +1805,7 @@ 13 - 100 + 101 1 0 0 @@ -1805,7 +1817,7 @@ 13 - 101 + 102 1 0 0 @@ -1817,7 +1829,7 @@ 13 - 102 + 103 1 0 0 @@ -1829,7 +1841,7 @@ 13 - 103 + 104 1 0 0 @@ -1849,7 +1861,7 @@ 0 14 - 104 + 105 1 0 0 @@ -1861,7 +1873,7 @@ 14 - 105 + 106 1 0 0 @@ -1873,7 +1885,7 @@ 14 - 106 + 107 1 0 0 @@ -1885,7 +1897,7 @@ 14 - 107 + 108 1 0 0 @@ -1897,7 +1909,7 @@ 14 - 108 + 109 1 0 0 @@ -1909,7 +1921,7 @@ 14 - 109 + 110 1 0 0 @@ -1921,7 +1933,7 @@ 14 - 110 + 111 1 0 0 @@ -1933,7 +1945,7 @@ 14 - 111 + 112 1 0 0 @@ -1945,7 +1957,7 @@ 14 - 112 + 113 1 0 0 @@ -1957,7 +1969,7 @@ 14 - 113 + 114 1 0 0 @@ -1969,7 +1981,7 @@ 14 - 114 + 115 1 0 0 @@ -1981,7 +1993,7 @@ 14 - 115 + 116 1 0 0 @@ -1993,7 +2005,7 @@ 14 - 116 + 117 1 0 0 @@ -2005,7 +2017,7 @@ 14 - 117 + 118 1 0 0 @@ -2017,7 +2029,7 @@ 14 - 118 + 119 1 0 0 @@ -2031,13 +2043,13 @@ eo-protocol - 1 + 0 0 0 0 15 - 119 + 120 1 0 0 @@ -2049,7 +2061,7 @@ 15 - 120 + 121 1 0 0 @@ -2061,7 +2073,7 @@ 15 - 121 + 122 1 0 0 @@ -2073,7 +2085,7 @@ 15 - 122 + 123 1 0 0 @@ -2085,7 +2097,7 @@ 15 - 123 + 124 1 0 0 @@ -2097,7 +2109,7 @@ 15 - 124 + 125 1 0 0 @@ -2109,7 +2121,7 @@ 15 - 125 + 126 1 0 0 @@ -2121,7 +2133,7 @@ 15 - 126 + 127 1 0 0 @@ -2133,7 +2145,7 @@ 15 - 127 + 128 1 0 0 @@ -2145,7 +2157,7 @@ 15 - 128 + 129 1 0 0 @@ -2157,7 +2169,7 @@ 15 - 129 + 130 1 0 0 @@ -2169,7 +2181,7 @@ 15 - 130 + 131 1 0 0 @@ -2181,7 +2193,7 @@ 15 - 131 + 132 1 0 0 @@ -2193,7 +2205,7 @@ 15 - 132 + 133 1 0 0 @@ -2205,7 +2217,7 @@ 15 - 133 + 134 1 0 0 @@ -2217,7 +2229,7 @@ 15 - 134 + 135 1 0 0 @@ -2231,13 +2243,13 @@ eo-protocol-cfg-callbacks - 1 + 0 0 0 0 16 - 135 + 136 1 0 0 @@ -2249,7 +2261,7 @@ 16 - 136 + 137 1 0 0 @@ -2261,7 +2273,7 @@ 16 - 137 + 138 1 0 0 @@ -2273,7 +2285,7 @@ 16 - 138 + 139 1 0 0 @@ -2287,13 +2299,13 @@ eoprot-can - 1 + 0 0 0 0 17 - 139 + 140 1 0 0 @@ -2305,7 +2317,7 @@ 17 - 140 + 141 1 0 0 @@ -2317,7 +2329,7 @@ 17 - 141 + 142 1 0 0 @@ -2337,7 +2349,7 @@ 0 18 - 142 + 143 1 0 0 @@ -2349,7 +2361,7 @@ 18 - 143 + 144 1 0 0 @@ -2361,7 +2373,7 @@ 18 - 144 + 145 1 0 0 @@ -2373,7 +2385,7 @@ 18 - 145 + 146 1 0 0 @@ -2385,7 +2397,7 @@ 18 - 146 + 147 1 0 0 @@ -2397,7 +2409,7 @@ 18 - 147 + 148 1 0 0 @@ -2417,7 +2429,7 @@ 0 19 - 148 + 149 8 0 0 @@ -2429,7 +2441,7 @@ 19 - 149 + 150 8 0 0 @@ -2441,7 +2453,7 @@ 19 - 150 + 151 8 0 0 @@ -2453,7 +2465,7 @@ 19 - 151 + 152 8 0 0 @@ -2473,7 +2485,7 @@ 0 20 - 152 + 153 8 0 0 @@ -2485,7 +2497,7 @@ 20 - 153 + 154 8 0 0 @@ -2497,7 +2509,7 @@ 20 - 154 + 155 8 0 0 @@ -2509,7 +2521,7 @@ 20 - 155 + 156 8 0 0 @@ -2521,7 +2533,7 @@ 20 - 156 + 157 8 0 0 diff --git a/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/proj/mc4plus.diagnostic2ready.uvprojx b/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/proj/mc4plus.diagnostic2ready.uvprojx index 37ce3545b..8aeeed472 100644 --- a/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/proj/mc4plus.diagnostic2ready.uvprojx +++ b/emBODY/eBcode/arch-arm/board/mc4plus/appl/v2/proj/mc4plus.diagnostic2ready.uvprojx @@ -10,7 +10,7 @@ mc4plus 0x4 ARM-ADS - 6150000::V6.15::ARMCLANG + 6160000::V6.16::ARMCLANG 1 @@ -908,6 +908,11 @@ 1 ..\..\..\..\ems004\appl\v2\src\eoappservices\EOthePOS.c + + EOtheFatalError.c + 1 + ..\..\..\..\ems004\appl\v2\src\eoappservices\EOtheFatalError.c + @@ -2232,6 +2237,11 @@ 1 ..\..\..\..\ems004\appl\v2\src\eoappservices\EOthePOS.c + + EOtheFatalError.c + 1 + ..\..\..\..\ems004\appl\v2\src\eoappservices\EOtheFatalError.c + diff --git a/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtask.c b/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtask.c index 5db7847ef..4be709209 100644 --- a/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtask.c +++ b/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtask.c @@ -34,6 +34,8 @@ #include "stdio.h" +#include "EOtheFatalError.h" + // -------------------------------------------------------------------------------------------------------------------- // - declaration of extern public interface // -------------------------------------------------------------------------------------------------------------------- @@ -110,6 +112,16 @@ static char s_eom_task_count = 0; #undef PRINT_TASK_ADDITIONAL_INFO +extern const char * eom_task_GetName(EOMtask *p) +{ + if(NULL == p) + { + return "null"; + } + + return p->nameof; +} + extern EOMtask * eom_task_New1(void) { EOMtask *retptr = NULL; @@ -150,6 +162,8 @@ extern eOresult_t eom_task_Init1(EOMtask *p, eOmtaskType_t type, uint8_t priorit retptr->extdata = extdata; + + snprintf(retptr->nameof, sizeof(retptr->nameof), "%s", NULL != name ? name : "unnamed"); // initialisations which depend on the type of task @@ -351,6 +365,8 @@ extern eOresult_t eom_task_Init1(EOMtask *p, eOmtaskType_t type, uint8_t priorit // osaltask must not be NULL, thus i check it. eo_errman_Assert(eo_errman_GetHandle(), (NULL != retptr->osaltask), "eom_task_New(): osal gives NULL osaltask", s_eobj_ownname, &eo_errman_DescrRuntimeErrorLocal); + eo_fatalerror_RegisterThread(eo_fatalerror_GetHandle(), retptr->osaltask, retptr->nameof); + s_eom_task_count ++; #if defined(PRINT_TASK_ADDITIONAL_INFO) char str[128] = {0}; @@ -425,6 +441,7 @@ extern EOMtask * eom_task_New(eOmtaskType_t type, uint8_t priority, uint16_t sta retptr->extdata = extdata; + snprintf(retptr->nameof, sizeof(retptr->nameof), "%s", NULL != name ? name : "unnamed"); // initialisations which depend on the type of task switch(type) @@ -625,6 +642,8 @@ extern EOMtask * eom_task_New(eOmtaskType_t type, uint8_t priority, uint16_t sta // osaltask must not be NULL, thus i check it. eo_errman_Assert(eo_errman_GetHandle(), (NULL != retptr->osaltask), "eom_task_New(): osal gives NULL osaltask", s_eobj_ownname, &eo_errman_DescrRuntimeErrorLocal); + eo_fatalerror_RegisterThread(eo_fatalerror_GetHandle(), retptr->osaltask, retptr->nameof); + s_eom_task_count ++; #if defined(PRINT_TASK_ADDITIONAL_INFO) char str[128] = {0}; diff --git a/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtask.h b/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtask.h index 252246df7..5471d0216 100644 --- a/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtask.h +++ b/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtask.h @@ -260,6 +260,8 @@ extern eOresult_t eom_task_PriorityGet(EOMtask *p, uint8_t *prio); **/ extern eOresult_t eom_task_PrioritySet(EOMtask *p, uint8_t prio); +extern const char * eom_task_GetName(EOMtask *p); + /** @} end of group eom_task diff --git a/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtask_hid.h b/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtask_hid.h index 4e2603f42..c4eac71b2 100644 --- a/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtask_hid.h +++ b/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtask_hid.h @@ -72,6 +72,7 @@ struct EOMtask_hid eOreltime_t ustime; eOevent_t waitmask; void *extdata; + char nameof[16]; }; diff --git a/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtheTimerManager.c b/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtheTimerManager.c index 23ca402ce..b26776248 100644 --- a/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtheTimerManager.c +++ b/emBODY/eBcode/arch-arm/embobj/core/exec/multitask/EOMtheTimerManager.c @@ -142,7 +142,7 @@ extern EOMtheTimerManager * eom_timerman_Initialise(const eOmtimerman_cfg_t *tmr eok_reltimeINFINITE, // timeoutorperiod NULL, sys_timerman, // nameofthetask_fn - "timerman"); + "tmrman"); diff --git a/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSbackdoor.c b/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSbackdoor.c index 0dff85ee0..5054e76be 100644 --- a/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSbackdoor.c +++ b/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSbackdoor.c @@ -183,7 +183,7 @@ extern EOMtheEMSbackdoor * eom_emsbackdoor_Initialise(const eOemsbackdoor_cfg_t s_emsbackdoor_singleton.task = eom_task_New(eom_mtask_EventDriven, cfg->taskpriority, cfg->taskstacksize, s_eom_emsbackdoor_task_startup, s_eom_emsbackdoor_task_run, (eOevent_t)0, eok_reltimeINFINITE, NULL, - tskEMSbackdoor, "tskEMSbackdoor"); + tskEMSbackdoor, "bckdoor"); diff --git a/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSconfigurator.c b/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSconfigurator.c index 221c7a118..77d487090 100644 --- a/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSconfigurator.c +++ b/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSconfigurator.c @@ -129,7 +129,7 @@ extern EOMtheEMSconfigurator * eom_emsconfigurator_Initialise(const eOemsconfigu s_emsconfigurator_singleton.task = eom_task_New(eom_mtask_EventDriven, cfg->taskpriority, cfg->taskstacksize, s_eom_emsconfigurator_task_startup, s_eom_emsconfigurator_task_run, (eOevent_t)0, timeout, NULL, - tskEMScfg, "tskEMScfg"); + tskEMScfg, "cfgST"); #if defined(EVIEWER_ENABLED) diff --git a/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSdiscoverylistener.c b/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSdiscoverylistener.c index 868759e34..3c7433abd 100644 --- a/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSdiscoverylistener.c +++ b/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSdiscoverylistener.c @@ -172,7 +172,7 @@ extern EOMtheEMSdiscoverylistener * eom_emsdiscoverylistener_Initialise(const eO s_emsdiscoverylistener_singleton.task = eom_task_New(eom_mtask_EventDriven, cfg->taskpriority, cfg->taskstacksize, s_eom_emsdiscoverylistener_task_startup, s_eom_emsdiscoverylistener_task_run, (eOevent_t)0, eok_reltimeINFINITE, NULL, - tskEMScfg, "tskEMSlis"); + tskEMScfg, "listener"); diff --git a/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSerror.c b/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSerror.c index 4f13e18f6..084b60fc3 100644 --- a/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSerror.c +++ b/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSerror.c @@ -132,7 +132,7 @@ extern EOMtheEMSerror * eom_emserror_Initialise(const eOemserror_cfg_t *cfg) s_emserror_singleton.task = eom_task_New(eom_mtask_EventDriven, cfg->taskpriority, cfg->taskstacksize, s_eom_emserror_task_startup, s_eom_emserror_task_run, (eOevent_t)0, timeout, NULL, - tskEMSerr, "tskEMSerr"); + tskEMSerr, "error"); s_emserror_singleton.timer = eo_timer_New(); diff --git a/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSrunner.c b/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSrunner.c index 4a1f93e20..1c03eb9e2 100644 --- a/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSrunner.c +++ b/emBODY/eBcode/arch-arm/embobj/plus/ctrloop/EOMtheEMSrunner.c @@ -271,7 +271,7 @@ extern EOMtheEMSrunner * eom_emsrunner_Initialise(const eOemsrunner_cfg_t *cfg) s_eom_emsrunner_taskRX_startup, s_eom_emsrunner_taskRX_run, (eOevent_t)(eo_emsrunner_evt_enable) | (eOevent_t)(eo_emsrunner_evt_execute), eok_reltimeINFINITE, NULL, - tskEMSrunRX, "tskEMSrunRX"); + tskEMSrunRX, "runRX"); s_theemsrunner.task[eo_emsrunner_taskid_runDO] = eom_task_New(eom_mtask_OnAllEventsDriven, cfg->taskpriority[eo_emsrunner_taskid_runDO], @@ -279,7 +279,7 @@ extern EOMtheEMSrunner * eom_emsrunner_Initialise(const eOemsrunner_cfg_t *cfg) s_eom_emsrunner_taskDO_startup, s_eom_emsrunner_taskDO_run, (eOevent_t)(eo_emsrunner_evt_enable) | (eOevent_t)(eo_emsrunner_evt_execute), eok_reltimeINFINITE, NULL, - tskEMSrunDO, "tskEMSrunDO"); + tskEMSrunDO, "runDO"); s_theemsrunner.task[eo_emsrunner_taskid_runTX] = eom_task_New(eom_mtask_OnAllEventsDriven, cfg->taskpriority[eo_emsrunner_taskid_runTX], @@ -287,7 +287,7 @@ extern EOMtheEMSrunner * eom_emsrunner_Initialise(const eOemsrunner_cfg_t *cfg) s_eom_emsrunner_taskTX_startup, s_eom_emsrunner_taskTX_run, (eOevent_t)(eo_emsrunner_evt_enable) | (eOevent_t)(eo_emsrunner_evt_execute), eok_reltimeINFINITE, NULL, - tskEMSrunTX, "tskEMSrunTX"); + tskEMSrunTX, "runTX"); #if defined(EOM_EMSRUNNER_EVIEW_MEASURES) eventviewer_load(ev_meas_rx_start, meas_rx_start); diff --git a/emBODY/eBcode/arch-arm/embobj/plus/ipnet/EOMtheIPnet.c b/emBODY/eBcode/arch-arm/embobj/plus/ipnet/EOMtheIPnet.c index 7d8f0a68f..208650d3c 100644 --- a/emBODY/eBcode/arch-arm/embobj/plus/ipnet/EOMtheIPnet.c +++ b/emBODY/eBcode/arch-arm/embobj/plus/ipnet/EOMtheIPnet.c @@ -390,7 +390,7 @@ extern EOMtheIPnet * eom_ipnet_Initialise(const eOmipnet_cfg_t *ipnetcfg, 0, ipnetcfg->procmaxidletime, NULL, tIPNETproc, - "ipnet.proc"); + "ipPRC"); #define IPNET_TICK_PERIODIC #if defined(IPNET_TICK_PERIODIC) @@ -400,7 +400,7 @@ extern EOMtheIPnet * eom_ipnet_Initialise(const eOmipnet_cfg_t *ipnetcfg, 0, s_eom_theipnet.ipcfg.sys_timetick, NULL, tIPNETtick, - "ipnet.tick"); + "ipTCK"); #else // and task which ticks the timers. it is an event based task with timeout. @@ -411,7 +411,7 @@ extern EOMtheIPnet * eom_ipnet_Initialise(const eOmipnet_cfg_t *ipnetcfg, 0, s_eom_theipnet.ipcfg.sys_timetick, NULL, tIPNETtick, - "ipnet.tick"); + "ipTCK"); #endif diff --git a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/api/hal_sys.h b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/api/hal_sys.h index 288db133d..c65d6e8b8 100644 --- a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/api/hal_sys.h +++ b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/api/hal_sys.h @@ -250,7 +250,7 @@ extern void hal_sys_atomic_bitwiseOR(volatile uint32_t *value, uint32_t mask); **/ extern void hal_sys_atomic_bitwiseAND(volatile uint32_t *value, uint32_t mask); - +extern uint32_t hal_sys_get_IPSR(void); /** @} end of group doxy_group_hal_sys diff --git a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/hal.stm32f4.uvoptx b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/hal.stm32f4.uvoptx index e8afb2461..5ce40f997 100644 --- a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/hal.stm32f4.uvoptx +++ b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/hal.stm32f4.uvoptx @@ -2056,7 +2056,7 @@ hal-extra-devices - 1 + 0 0 0 0 @@ -2208,7 +2208,7 @@ hal-extra-periphs - 1 + 0 0 0 0 diff --git a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/hal.stm32f4.uvprojx b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/hal.stm32f4.uvprojx index bab9d20a5..7b5a90fd8 100644 --- a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/hal.stm32f4.uvprojx +++ b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/hal.stm32f4.uvprojx @@ -2164,7 +2164,7 @@ 1 0 0 - 1 + 0 .\Lst\ 1 0 @@ -4122,7 +4122,7 @@ 1 0 0 - 1 + 0 .\Lst\ 1 0 @@ -5049,8 +5049,8 @@ 0 1 0 - 1 - 1 + 0 + 0 .\Lst\ 1 0 diff --git a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.ems4rd.ethdbg.lib b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.ems4rd.ethdbg.lib index dfd24468b..a7ff4322e 100644 Binary files a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.ems4rd.ethdbg.lib and b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.ems4rd.ethdbg.lib differ diff --git a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.ems4rd.lib b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.ems4rd.lib deleted file mode 100644 index 614a4f50c..000000000 Binary files a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.ems4rd.lib and /dev/null differ diff --git a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.mc2plus.ethdbg.lib b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.mc2plus.ethdbg.lib index fddbc3484..8f07dedf8 100644 Binary files a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.mc2plus.ethdbg.lib and b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.mc2plus.ethdbg.lib differ diff --git a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.mc4plus.ethdbg.lib b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.mc4plus.ethdbg.lib index b2f335f4a..b4bdab5e0 100644 Binary files a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.mc4plus.ethdbg.lib and b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.mc4plus.ethdbg.lib differ diff --git a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.mc4plus.lib b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.mc4plus.lib deleted file mode 100644 index f82968a83..000000000 Binary files a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/lib/hal2.mc4plus.lib and /dev/null differ diff --git a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/src/core/hal_sys.c b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/src/core/hal_sys.c index cb1277760..3d720dbe4 100644 --- a/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/src/core/hal_sys.c +++ b/emBODY/eBcode/arch-arm/libs/highlevel/abslayer/hal2/src/core/hal_sys.c @@ -159,6 +159,11 @@ extern hal_result_t hal_sys_init(const hal_sys_cfg_t* cfg) return(hal_res_OK); } +extern uint32_t hal_sys_get_IPSR(void) +{ + return __get_IPSR(); +} + extern uint32_t hal_sys_stack_get_totalsize(void) { return(hl_sys_stack_totalsize_get());