freeRTOS otaサンプルコードにユーザーアプリケーションを組み込む方法について

こんにちは。よこです。

以下のアプリケーションノートを使ってユーザーアプリケーションを組み込んでデモを作ろうとしています。

"RX65N における Amazon Web Services を利用した FreeRTOS OTA の実現方法"

Freertosのソフトタイマーを使って0.1秒間隔でLチカを行うアプリを入れ込もうとしています。

ですが、LEDの初期化はできるものの肝心のLチカとOTA動作時に表示されるteratermのログが出ない状況です。そのため、OTAのタスクとLチカのタスクが実行されていないのかと考えています。

デバッグをしてみるとvTaskDelay(10000);の実行中に不明なアドレスにとんでいるようです。

OTAのプロジェクトにユーザーアプリケーションを組み込んだ方がいらっしゃいましたらタスクの組み込み方についてご教授願えませんでしょうか。

実行環境

評価ボード RX65N-RSK

FreeRTOS ver v202012.00-rx-1.0.0

コンパイラ ver CC-RX  v2.08.01

以下、ソース・コード

main_task.c

* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* www.renesas.com/disclaimer
*
* Copyright (C) 2014(2016) Renesas Electronics Corporation. All rights reserved.
*********************************************************************************************************************/
/**********************************************************************************************************************
* File Name : main_task.c
* Description : main task
*********************************************************************************************************************/
/**********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 29.12.2019 1.00 First Release
*********************************************************************************************************************/

/******************************************************************************
Includes <System Includes> , "Project Includes"
******************************************************************************/

/* for using C standard library */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

/* for using FIT Module */
#include "platform.h"
#include "r_pinset.h"
#include "r_flash_rx_if.h"
#include "Pin.h"

/* for using Amazon FreeRTOS */
#include "FreeRTOS.h"
#include "aws_application_version.h"
#include "r_simple_filesystem_on_dataflash_if.h"


#include "timers.h"
#include "r_gpio_rx_if.h"
extern TimerHandle_t swt_handle_1;


/**********************************************************************************************************************
Typedef definitions
**********************************************************************************************************************/
//#define RX72N_ENVISION_KIT_TASKS_STACK 1024

/******************************************************************************
External variables
******************************************************************************/
xSemaphoreHandle xSemaphoreFlashAccess;

/******************************************************************************
Private global variables
******************************************************************************/


/******************************************************************************

External functions
******************************************************************************/


void main_task(void);

/******************************************************************************
Function Name : main
Description : Main task
Arguments : none
Return value : none
******************************************************************************/
void main_task(void)
{
uint32_t bank_info;

/* enable MCU pins */
R_Pins_Create();


/* flash initialization */
R_FLASH_Open();
R_FLASH_Control(FLASH_CMD_BANK_GET, &bank_info);
R_SFD_Open();

/* flash access semaphore creation */
xSemaphoreFlashAccess = xSemaphoreCreateMutex();
xSemaphoreGive(xSemaphoreFlashAccess);

// task_info.main_task_handle = xTaskGetCurrentTaskHandle();

xTimerChangePeriod(swt_handle_1, pdMS_TO_TICKS( 100 ), 0);
xTimerStart( swt_handle_1, 0);
R_GPIO_PinWrite(GPIO_PORT_G_PIN_5,GPIO_LEVEL_LOW);
R_GPIO_PinDirectionSet(GPIO_PORT_G_PIN_5,GPIO_DIRECTION_OUTPUT);

while(1){
vTaskDelay(10000);
}


}
/******************************************************************************
End of function main_task()
******************************************************************************/

void Blink_TimerCallback(TimerHandle_t xTimer)
{
static gpio_level_t light=GPIO_LEVEL_LOW;
light ^= 1;
R_GPIO_PinWrite(GPIO_PORT_G_PIN_5, light);
}

/******************************************************************************
End Of File
******************************************************************************/

freertos_object_init.c

/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* www.renesas.com/disclaimer
*
* Copyright (C) 2019 Renesas Electronics Corporation. All rights reserved.
**********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : freertos_object_init.c
* Version : 1.0
* Description :
**********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 07.12.2018 1.00 First Release
**********************************************************************************************************************/

/***********************************************************************************************************************
* Includes <System Includes> , "Project Includes"
**********************************************************************************************************************/
#include "FreeRTOS.h"
#include "freertos_start.h"
#include "timers.h"
/***********************************************************************************************************************
* Macro definitions
**********************************************************************************************************************/

/***********************************************************************************************************************
* Typedef definitions
**********************************************************************************************************************/

/***********************************************************************************************************************
* Private global variables and functions
**********************************************************************************************************************/
void Kernel_Object_init (void);
void Object_init_manual (void);
TimerHandle_t swt_handle_1 = NULL;
extern void Blink_TimerCallback(TimerHandle_t xTimer);
/***********************************************************************************************************************
* Function Name: Kernel_Object_init
* Description : This function initializes FreeRTOS objects.
* Arguments : None.
* Return Value : None.
**********************************************************************************************************************/
void Kernel_Object_init (void)
{
/************** task creation ****************************/

/************** semaphore creation ***********************/

/************** queue creation ***************************/

/************** software time creation **************************/

swt_handle_1 = xTimerCreate("Timer_1", 1000, pdTRUE, 0, Blink_TimerCallback);
if (swt_handle_1 == NULL)
{
/* Failed! Timer can not be created. */
}

/************** event groups creation ********************/

/************** stream buffer creation *************************/

/************** message buffer creation *********************/

} /* End of function Kernel_Object_init()*/

/***********************************************************************************************************************
* Function Name : Object_init_manual
* Description : This function re-initializes FreeRTOS objects and should be called at runtime.
* Arguments : None.
* Return value : None.
**********************************************************************************************************************/
void Object_init_manual (void)
{
/************** task creation ****************************/
} /* End of function Object_init_manual()*/

Parents Reply Children
No Data