This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432P4011: A reset occurred on the target

Part Number: MSP432P4011

Hi there,

I am not able to debug my microcontroller as at launch a reset occurs on the target.

It looks like WDT kicks in, as there is a fair amount of data that is probably allocated at init.

I found a possible solution here: https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/470334?MSP432-In-Reset-A-Reset-Occurred-On-The-Target , but in my case it does not solve the issue. Where is system_pre_init called? How can I make sure it is executed prior to memory allocation?

Many thanks

  • Hi Giovanni,

    Checkout section 5.3 in the MSP430 GCC User's guide

    It looks like you can assign a function (disable_watchdog) to be run early as part of the system initializations

    I think it works something like this:

     .

  • Hello Dennis,

    thank you very much! That looked promising, but unfortunately did not solve the issue.(a syntax difference in attributes specification between gcc and g++ maybe?)

    I am developing C++17 code, using the new feature of inline static definition inside class declaration. I guess that data goes into BSS.

    I will try to get back to C++11 standard, do you think that might help, or the problem are essentially statics?

    Another point: I am using heap and I have configured the linker script as below. Does anybody spot some mistake?

    HEAPSIZE = 0x32000;
    
    MEMORY
    {
        MAIN_FLASH (RX) : ORIGIN = 0x00000000, LENGTH = 0x00200000
        INFO_FLASH (RX) : ORIGIN = 0x00200000, LENGTH = 0x00008000
        SRAM_DATA  (RW) : ORIGIN = 0x20000000, LENGTH = 0x00040000
    }
    
    REGION_ALIAS("REGION_TEXT", MAIN_FLASH);
    REGION_ALIAS("REGION_INFO", INFO_FLASH);
    REGION_ALIAS("REGION_BSS", SRAM_DATA);
    REGION_ALIAS("REGION_DATA", SRAM_DATA);
    REGION_ALIAS("REGION_STACK", SRAM_DATA);
    REGION_ALIAS("REGION_HEAP", SRAM_DATA);
    REGION_ALIAS("REGION_ARM_EXIDX", MAIN_FLASH);
    REGION_ALIAS("REGION_ARM_EXTAB", MAIN_FLASH);
    
    SECTIONS {
    
        /* section for the interrupt vector area                                 */
        PROVIDE (_intvecs_base_address =
            DEFINED(_intvecs_base_address) ? _intvecs_base_address : 0x0);
    
        .intvecs (_intvecs_base_address) : AT (_intvecs_base_address) {
            KEEP (*(.intvecs))
        } > REGION_TEXT
    
        /* The following three sections show the usage of the INFO flash memory  */
        /* INFO flash memory is intended to be used for the following            */
        /* device specific purposes:                                             */
        /* Flash mailbox for device security operations                          */
        PROVIDE (_mailbox_base_address = 0x200000);
    
        .flashMailbox (_mailbox_base_address) : AT (_mailbox_base_address) {
            KEEP (*(.flashMailbox))
        } > REGION_INFO
    
        /* TLV table for device identification and characterization              */
        PROVIDE (_tlv_base_address = 0x00201000);
    
        .tlvTable (_tlv_base_address) (NOLOAD) : AT (_tlv_base_address) {
            KEEP (*(.tlvTable))
        } > REGION_INFO
    
        /* BSL area for device bootstrap loader                                  */
        PROVIDE (_bsl_base_address = 0x00202000);
    
        .bslArea (_bsl_base_address) : AT (_bsl_base_address) {
            KEEP (*(.bslArea))
        } > REGION_INFO
    
        PROVIDE (_vtable_base_address =
            DEFINED(_vtable_base_address) ? _vtable_base_address : 0x20000000);
    
        .vtable (_vtable_base_address) : AT (_vtable_base_address) {
            KEEP (*(.vtable))
        } > REGION_DATA
    
        .text : {
            CREATE_OBJECT_SYMBOLS
            KEEP (*(.text))
            *(.text.*)
            . = ALIGN(0x4);
            KEEP (*(.ctors))
            . = ALIGN(0x4);
            KEEP (*(.dtors))
            . = ALIGN(0x4);
            __init_array_start = .;
            KEEP (*(.init_array*))
            __init_array_end = .;
            KEEP (*(.init))
            KEEP (*(.fini*))
        } > REGION_TEXT AT> REGION_TEXT
    
        .rodata : {
            *(.rodata)
            *(.rodata.*)
        } > REGION_TEXT AT> REGION_TEXT
    
        .ARM.exidx : {
            __exidx_start = .;
            *(.ARM.exidx* .gnu.linkonce.armexidx.*)
            __exidx_end = .;
        } > REGION_ARM_EXIDX AT> REGION_ARM_EXIDX
    
        .ARM.extab : {
            KEEP (*(.ARM.extab* .gnu.linkonce.armextab.*))
        } > REGION_ARM_EXTAB AT> REGION_ARM_EXTAB
    
        __etext = .;
    
        .data : {
            __data_load__ = LOADADDR (.data);
            __data_start__ = .;
            KEEP (*(.data))
            KEEP (*(.data*))
            . = ALIGN (4);
            __data_end__ = .;
        } > REGION_DATA AT> REGION_TEXT
    
        .bss : {
            __bss_start__ = .;
            *(.shbss)
            KEEP (*(.bss))
            *(.bss.*)
            *(COMMON)
            . = ALIGN (4);
            __bss_end__ = .;
        } > REGION_BSS AT> REGION_BSS
    
        .heap : ALIGN(0x8) {
            __heap_start__ = .;
            KEEP (*(.heap))
            . += HEAPSIZE;
            . = ALIGN (8);
            end = .;
            _end = end;
            __end = end;
            __heap_end__ = .;
            __HeapLimit = __heap_end__;
        } > REGION_HEAP AT> REGION_HEAP
    
        .stack (NOLOAD) : ALIGN(0x8) {
            _stack = .;
            KEEP(*(.stack))
        } > REGION_STACK AT> REGION_STACK
    
    	__StackTop = ORIGIN(REGION_STACK) + LENGTH(REGION_STACK);
        PROVIDE(__stack = __StackTop);
    }
    
    

  • Using ".crt*" sections to control pre-main initialization is a feature unique to MSP430-GCC. MSP432 uses the ARM Embedded GCC toolchain, which doesn't have this feature.

    You might be able to put an entry for disable_watchdog in ".init_array" instead, to get it to run before main.

    Regards,

  • CRT operations were taking too long for constructing objects.

    The issue can be easily solved by creating a watchdog object (WDT) halting itself in the constructor, and instantiating it as the very first data structure to be built by the CRT.

    To make sure of objects initialization order I rolled back to the C++11 approach, defining all global data members in a separate source file, preceded by the WDT, to take full control of the constructors sequence and avoid the static init order fiasco.