S32K344看门狗无法复位

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K344看门狗无法复位

501 Views
chenyuhang
Contributor I

Hello, nxp的技术支持

我最近在使用s32k344芯片的swt时发现,初始化swt后,在freertos的任务里不定时进行喂狗操作,或者说直接把喂狗程序注释掉,程序依然不会复位,这种情况在插着仿真器或者不插着仿真器时的现象一样。我想请问一下是我使用的有问题吗?以下我贴出了配置图片以及喂狗程序(我还开启了Power_ip,开启以后没有进行多余配置)

chenyuhang_0-1767863129338.png

 

#include "main.h"

#include "Power_Ip.h"

#include "swt.h"

volatile int exit_code = 0;

TaskHandle_t StartTask_Handler; //任务句柄

void start_task(void *pvParameters) //任务函数
{
	(void)pvParameters;
	static uint32_t period_100ms_counter = 0;

	while(1)
	{
		if(period_100ms_counter == 9)
		{
			// swt_feeddog();
		}
		else if(period_100ms_counter == 10)
		{
			led_toggle();
			period_100ms_counter = 0;
		}
		else
		{
			;
		}
		period_100ms_counter++;
		vTaskDelay(100);
	}
}

int main(void)
{
	Clock_Ip_Init(&Clock_Ip_aClockConfig[0]);

	Power_Ip_Init(&Power_Ip_HwIPsConfigPB);

	OsIf_Init(NULL_PTR);

	// 初始化中断控制器
    IntCtrl_Ip_Init(&IntCtrlConfig_0);

	siul2_init();

	ICU_Init();

	siul2_task_init();

	lpuart_init();

	userShellInit();

	shell_regisiter_log();

	adc_init();

	adc_task_init();

	flexcan2_init();

	flexcan_task_init();

	flashdb_init();

	//TODO: 调试lfs,目前还有些问题
	// fatfs_example();

	modecontrol_task_init();

	swt_init();

	if(xTaskCreate(start_task, "start_task", START_STK_SIZE, NULL, START_TASK_PRIO, &StartTask_Handler) != pdPASS)
	{
		logError("start task creat failed");
	}

	vTaskStartScheduler();

    for(;;)
    {
    	vTaskDelay(500);
        if(exit_code != 0)
        {
            break;
        }
    }
    return exit_code;
}

 

0 Kudos
Reply
3 Replies

464 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @chenyuhang 

Let’s isolate the issue by working only with a project that involves the SWT. Could you please try the Example S32K312 SWT DS3.5 RTD300?

 

BR, VaneB

0 Kudos
Reply

439 Views
chenyuhang
Contributor I

Hi @VaneB 

Thanks for your reply. I don't have the RTD3.0.0 SDK. but I used the RTD6.0.0 SDK(my practical application is based on RTD6.0.0) and rebuilt a project that includes SWT as same as my practical application. Currently, the watchdog system cannot reset due to feeding the dog beyond the time limit. I have placed the project in the attachment. Could you please help me check where the problem lies? 

感谢您的回复。我没有RTD3.0.0的SDK,我使用了RTD6.0.0的SDK(我实际应用的工程是基于RTD6.0.0的)并且重新搭建了一个工程和我的实际应用工程一样,包含了SWT,目前看门狗也无法因为超时喂狗而导致系统复位,工程我放在附件中了,可以帮我看一下是哪里出了问题吗?

Best regards/Chenyuhang

0 Kudos
Reply

268 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @chenyuhang 

Did you check the IP_MC_RGM->FES[SWT0_RST] register to confirm whether the SWT0_RST event has occurred?

Since you are working with an S32K344 device, I recommend running the Swt_Ip_Example_S32K344 provided in the RTD package. This example will help validate that the SWT is functioning as expected and that the interrupt is being triggered correctly. You can also modify the example configuration to generate either a reset or an interrupt when a timeout occurs.

 

BR, VaneB

0 Kudos
Reply