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.

RTOS/AM5728: "how to merge Board_init(boardCfg);" by using PROCESSOR-SDK-RTOS-AM57X

Guru 10235 points
Part Number: AM5728

Tool/software: TI-RTOS

Hello, TI Experts,

 

Our customer sent us question about "how to merge Board_init(boardCfg);" by using PROCESSOR-SDK-RTOS-AM57X.

They tried to design EcMaster product referring http://www.ti.com/lit/ug/tidubz1b/tidubz1b.pdf

 

Now they tried to create MLO for acontis EC-Master(EcMasterDemoICSS).

Then they found Board_init(boardCfg); function in both sbl_main.c in pdk and main.c in EcMasterDemoICSS like below.

 

-sbl_main.c

   boardCfg |= BOARD_INIT_UNLOCK_MMR |

       BOARD_INIT_MODULE_CLOCK |

       BOARD_INIT_PINMUX_CONFIG |

       BOARD_INIT_DDR |

       BOARD_INIT_UART_STDIO |

       BOARD_INIT_WATCHDOG_DISABLE;

   Board_init(boardCfg);

 

-main.c in EcMasterDemoICSS

   Board_initCfg boardCfg = BOARD_INIT_UNLOCK_MMR | BOARD_INIT_PINMUX_CONFIG |

           BOARD_INIT_MODULE_CLOCK | BOARD_INIT_UART_STDIO;

   Board_init(boardCfg);

 

Question:

  Can we remove "Board_init(boardCfg);" of main.c in EcMasterDemoICSS?

   (sbl_main.c seems to cover the same boardCfg function in main.c.)

 

We would like to attach both c-files as a reference.

If there are any notice or comment, please tell us.

 

Best regards,

 

6862.main.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*-----------------------------------------------------------------------------
* main.c startup file for ti rtos application
* Copyright acontis technologies GmbH, Weingarten, Germany
* Response Mikhail Ledyaev
* Description starts EcMainDemo function.
*---------------------------------------------------------------------------*/
#include <xdc/std.h>
#include <xdc/runtime/Error.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/timers/dmtimer/Timer.h>
#include <ti/board/board.h>
#include <ti/drv/uart/UART_stdio.h>
#include <EcVersion.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
Timer_Handle g_auxClocksTimerHandle = 0;
//extern int EcMasterDemo(void);
extern int CatMasterMain(void);
extern void pcieMmuInitial(void);
#define BOARD_IDKAM571x 1
#define BOARD_IDKAM572x 2
void InitAuxClockTimer()
{
const UInt auxClockTimerInstance = 1; // instance number defined in EcMaster.cfg
g_auxClocksTimerHandle = Timer_getHandle(auxClockTimerInstance);
}
void TimerEmptyISR()
{
}
/**
* �N����̏����^�X�N���C��
*/
void TaskFxn(UArg a0, UArg a1)
{
InitAuxClockTimer();
UART_printf("\n\rSYS/BIOS EcMasterDemo ICSS Sample application\n\r");
// EcMasterDemo();
// EtherCat���C�����[�v�����B
CatMasterMain();
}
volatile int dbg_flg = 1;
int main()
{
Board_IDInfo info;
Error_Block eb;
uint8_t board_type = 0;
Task_Params taskParams;
while(dbg_flg);
// PCIe�Ɋ֘A����AMMU�ݒ�
// pcieMmuInitial();
Board_initCfg boardCfg = BOARD_INIT_UNLOCK_MMR | BOARD_INIT_PINMUX_CONFIG |
BOARD_INIT_MODULE_CLOCK | BOARD_INIT_UART_STDIO;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

8562.sbl_main.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* \file sbl_main.c
*
* \brief This file contain main function, call the Board Initialization
* functions & slave core boot-up functions in sequence.
*
*/
/*
* Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/* TI RTOS header files */
#include <ti/csl/cslr_device.h>
#include <ti/board/board.h>
#include <ti/drv/uart/UART.h>
#include <ti/drv/uart/src/UART_osal.h>
#include <ti/drv/uart/UART_stdio.h>
#include <ti/csl/tistdtypes.h>
#include <ti/csl/csl_a15.h>
#include "sbl_slave_core_boot.h"
#include "sbl_avs_config.h"
#include "sbl_ver.h"
/**********************************************************************
************************** Macros ************************************
**********************************************************************/
/**********************************************************************
************************** Internal functions ************************
**********************************************************************/
/**********************************************************************
************************** Global Variables **************************
**********************************************************************/
sblEntryPoint_t idkAM572xEntry;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Matusan,

    Yes, the SOC and board initialization that has already been done in SBL from boot can be removed from application to avoid duplication and to consolidate all of the initialization in the SBL. This also will help your customer to reduce the system boot time.

    We add the Board_init in the PDK driver unit test application to allow user to test the application independent of the SBL and to allow for testing over JTAG.  Some users also opt to keep the Board_init in SBL and application so the application doesn`t make any assumptions of initialization done by the bootloader and there is no dependency between the two components.

    Regards,
    Rahul

  • Hi,

    Thank you very much for your kindness.
    I really appreciate your help.
    I will send the answer to the customer.

    Best regards,