AnsweredAssumed Answered

ConfigTools issue: Watchdog configuration for LPC54113

Question asked by Eduardo Carletti on Jan 14, 2020
Latest reply on Jan 16, 2020 by Eduardo Carletti

Hello everyone,

I am developing a project using the LCP54113 MCU wich requires watchdog.

I used the ConfigTools to facilitate the configuration, but there seems to be a problem. The code generated does not sets the frequency for the WWDT. The workaround I found was to manually set, by doing:

 

#define WDT_CLK_FREQ CLOCK_GetFreq(kCLOCK_WdtOsc)

WWDT_1_config.clockFreq_Hz = WDT_CLK_FREQ;

 

Of couse, this requires me to change the declaration of "WWDT_1_config" both on peripherals.c and peripherals.h file, removing the "const" declaration. This is pretty annoying, as long I have to do this every time there is any change on the chip configurations generated by ConfigTools. If i don't do this, the processor stalls on initialization, once "WWDT_1_config.clockFreq_Hz = 0".

Is there any known bugs related to this? Could be there any mistake from me?

 

The WWDT component configurations are:

 

The code generated for WWDT is:

/***********************************************************************************************************************
* WWDT_1 initialization code
**********************************************************************************************************************/
/* clang-format off */
/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
instance:
- name: 'WWDT_1'
- type: 'wwdt'
- mode: 'reset_mode'
- custom_name_enabled: 'true'
- type_id: 'wwdt_2cb925533f814de0a276eb97fc166b0f'
- functional_group: 'BOARD_InitPeripherals'
- peripheral: 'WWDT'
- config_sets:
- general:
- wwdt_config:
- clockSource: 'FunctionClock'
- clockSourceFreq: 'BOARD_BootClockHSRUN'
- enableWwdt: 'true'
- enableWatchdogProtect: 'false'
- enableLockOscillator: 'false'
- timeoutValue_input: '0xFFFFFF'
- windowEnable: 'false'
- warningValue_input: '512'
- interrupt:
- IRQn: 'WDT_BOD_IRQn'
- enable_priority: 'false'
- priority: '0'
- enable_custom_name: 'false'
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
/* clang-format on */
const wwdt_config_t WWDT_1_config = {
.enableWwdt = true,
.enableWatchdogReset = true,
.enableWatchdogProtect = false,
.enableLockOscillator = false,
.windowValue = WWDT_1_WINDOW,
.timeoutValue = WWDT_1_TIMEOUT,
.warningValue = WWDT_1_WARNING
};

void WWDT_1_init(void) {
/* WWDT_1 initiation */
WWDT_Init(WWDT_1_PERIPHERAL, &WWDT_1_config);
/* Enable interrupt WDT_BOD_IRQn request in the NVIC */
EnableIRQ(WWDT_1_IRQN);
}

Outcomes