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/F28M35H52C: EPI external SRAM initialization and .bss allocation

Part Number: F28M35H52C
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hi,

I have trouble putting .bss section in external SRAM connected through EPI.

Configuration:
Target F28M35H52C1 (Cortex-M3 + C2000 DSP)    CCS Version: 5.5.0.00077    Compiler TI v5.1.1    IPC 3.10.1.11     SYS/BIOS 6.35.04.50    TI RTOS 1.20.0.28
Hardware is a custom board with F28M35H52C1 processor, 2 Mbyte external SRAM (Alliance Memory AS6C1616-55TIN) and LCD controller (EPSON S1D13742) on EPI bus.

I already use this external SRAM to store GUI images (1Mbyte) and the display buffer (768 Kbytes), some other sections, which all works fine, and ARM_EXTRAM section where I want to store .bss.

Here is an extract of the cmd file:
    MEMORY
   {
      EXTRAM (RW)            : origin = 0x60020D00, length = 0xBB800
      EXTRAM_BIN (RW)     : origin = 0x600DC500, length = 0x100000
      ARM_EXTRAM (RWX) : origin = 0x601E6E10, length = 0x191F0
   }
   SECTIONS
   {
      .SDRRAM                    : > EXTRAM
      .REMOTE_BIN             : > EXTRAM_BIN
      .bss                              : > ARM_EXTRAM
    }

EXTRAM and EXTRAM_BIN are used with #pragma:
#pragma DATA_SECTION(GuiLib_DisplayBuf,".SDRRAM")
#pragma DATA_SECTION(SD_Card_RamBuffer,".REMOTE_BIN")

EPI is configured with EPI_Init() in EPI_config.c (see attachment below) which is called in those two functions:

EPI_config.c
//###########################################################################
// FILE:   EPI_config.c
// TITLE:  EPI Interface
//###########################################################################

// Definitions
#define EXTERNAL_DISPLAY_ADDR 		    0xA0000000
#define EXTERNAL_RAM_ADDR 				0x60000000

static void SetPortControl(void);

void EPI_Init()
{
	// Enable Clock for EPI & GPIO Ports
	SysCtlPeripheralEnable(SYSCTL_PERIPH_EPI0);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ);

	// Configure the GPIO setting for the EPI pins.
	SetPortControl();

	// Port C EPI configuration
	GPIODirModeSet(GPIO_PORTC_BASE,
			           (GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7),
			           GPIO_DIR_MODE_HW);

	GPIOPadConfigSet(GPIO_PORTC_BASE,
					 (GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7),
					 GPIO_PIN_TYPE_STD_WPU);

	// Port D EPI configuration
	GPIODirModeSet(GPIO_PORTD_BASE,
				   (GPIO_PIN_6 | GPIO_PIN_7 ),
				   GPIO_DIR_MODE_HW);

	GPIOPadConfigSet(GPIO_PORTD_BASE,
					 (GPIO_PIN_6 | GPIO_PIN_7),
					 GPIO_PIN_TYPE_STD_WPU);

	// Port H EPI configuration
	GPIODirModeSet(GPIO_PORTH_BASE,
				   (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 |
						   	   	   	   GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7), GPIO_DIR_MODE_HW);

	GPIOPadConfigSet(GPIO_PORTH_BASE,
			   (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 |
					   	   	   	   	   GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7), GPIO_PIN_TYPE_STD_WPU);

	// Port E EPI configuration
	GPIODirModeSet(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 , GPIO_DIR_MODE_HW);

	GPIOPadConfigSet(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 , GPIO_PIN_TYPE_STD_WPU);

	// Port F EPI configuration
	GPIODirModeSet(GPIO_PORTF_BASE, GPIO_PIN_4 | GPIO_PIN_5, GPIO_DIR_MODE_HW);

	GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_4 | GPIO_PIN_5, GPIO_PIN_TYPE_STD_WPU);

	// Port G EPI configuration
	GPIODirModeSet(GPIO_PORTG_BASE, GPIO_PIN_0 | GPIO_PIN_1 , GPIO_DIR_MODE_HW);

	GPIOPadConfigSet(GPIO_PORTG_BASE, GPIO_PIN_0 | GPIO_PIN_1 , GPIO_PIN_TYPE_STD_WPU);

	// Port J EPI configuration
	GPIODirModeSet(GPIO_PORTJ_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 |
															GPIO_PIN_3 |GPIO_PIN_4 , GPIO_DIR_MODE_HW);

	GPIOPadConfigSet(GPIO_PORTJ_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 |
															GPIO_PIN_3 |GPIO_PIN_4 , GPIO_PIN_TYPE_STD_WPU);

	// Set 16 Bit HostBus mode.
    EPIModeSet(EPI0_BASE, EPI_MODE_HB16);

    //Set clock divider to 0. With this EPI Frq will be equal to system clock.
    EPIDividerSet(EPI0_BASE, 0x01);

    // Read wait state = 0
    // Write wait state = 0
    // Address & Data are muxed (ADNOMUX = 0x0).
    EPIConfigHB16Set(EPI0_BASE, (EPI_HB16_MODE_ADMUX | EPI_HB16_WRWAIT_0 | EPI_HB16_RDWAIT_0), 0);

    //External RAM Address At 0x6000.0000
    //External RAM Size = 16MB; lower address range: 0x00.0000 to 0xFF.FFFF
    //External Peripheral Address At 0xA000.0000
    //External Peripheral Size = 64KB; lower address range: 0x0000 to 0xFFFF
    EPIAddressMapSet(EPI0_BASE, (EPI_ADDR_PER_SIZE_64KB | EPI_ADDR_RAM_SIZE_16MB | EPI_ADDR_RAM_BASE_6 | EPI_ADDR_PER_BASE_A) );

//  GPIOPinTypeGPIOOutput(GPIO_PORTJ_BASE, GPIO_PIN_5);
//	GPIOPinWrite(GPIO_PORTJ_BASE, GPIO_PIN_5, ~0);

    //Set GPIO Pin to output type. LCD Address/Data Enable Line
	GPIOPinTypeGPIOOutput(GPIO_PORTG_BASE, GPIO_PIN_7);
	GPIOPinWrite(GPIO_PORTG_BASE, GPIO_PIN_7, ~0);

//	GPIOPinTypeGPIOOutput(GPIO_PORTH_BASE, GPIO_PIN_7);
//	GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_7, ~0);

    // word access mode enabled.
    // EPI0S30 is used as CSn/CEn
    HWREG(EPI0_BASE + EPI_O_HB16CFG2) = 0x83000000;

//    GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1);
//    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, ~0);
//    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, 0);
//    for(i=0;i<10;i++);
//    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, ~0);

//    HWREG(EPI0_BASE + EPI_O_BAUD) = 0x00001;

    //Read Size is 16bit;
    HWREG(EPI0_BASE + EPI_O_RSIZE0) = 0x02;

}

//*********************************************************************************************************************
/**
* 	@brief Description : Configure the GPIO Port control Register for EPI.
*
* 	@param 	 None
* 	@return  None
*/
//*********************************************************************************************************************
static void SetPortControl(void)
{
    //
    // GPIO Port C pins
    //

    HWREG(GPIO_PORTC_BASE + GPIO_O_PCTL) |= GPIO_PCTL_PC4_EPI0S2 |
                                           GPIO_PCTL_PC5_EPI0S3 |
                                           GPIO_PCTL_PC6_EPI0S4 |
                                           GPIO_PCTL_PC7_EPI0S5;

	//
	// GPIO Port D pins
	//
	HWREG(GPIO_PORTD_BASE + GPIO_O_PCTL) |= GPIO_PCTL_PD7_EPI0S30 |
										   GPIO_PCTL_PD6_EPI0S29 ;

	//
	// GPIO Port E pins
	//
	HWREG(GPIO_PORTE_BASE + GPIO_O_PCTL) |= GPIO_PCTL_PE0_EPI0S8 |
											GPIO_PCTL_PE1_EPI0S9 ;

	//
	// GPIO Port F pins
	//
	HWREG(GPIO_PORTF_BASE + GPIO_O_PCTL) |= GPIO_PCTL_PF4_EPI0S12 |
											GPIO_PCTL_PF5_EPI0S15 ;

	//
	// GPIO Port G pins
	//
	HWREG(GPIO_PORTG_BASE + GPIO_O_PCTL) |= GPIO_PCTL_PG0_EPI0S13 |
											GPIO_PCTL_PG1_EPI0S14 ;

    //
    // GPIO Port H pins
    //
    HWREG(GPIO_PORTH_BASE + GPIO_O_PCTL) |= GPIO_PCTL_PH0_EPI0S6 |
                                           GPIO_PCTL_PH1_EPI0S7  |
                                           GPIO_PCTL_PH2_EPI0S1  |
                                           GPIO_PCTL_PH6_EPI0S26 |
                                           GPIO_PCTL_PH5_EPI0S11 |
                                           GPIO_PCTL_PH4_EPI0S10 |
                                           GPIO_PCTL_PH7_EPI0S27 |
                                           GPIO_PCTL_PH3_EPI0S0 ;

    //
    // GPIO Port J pins
    //
    HWREG(GPIO_PORTJ_BASE + GPIO_O_PCTL) |= GPIO_PCTL_PJ0_EPI0S16 |
    										GPIO_PCTL_PJ4_EPI0S28 |
    										GPIO_PCTL_PJ1_EPI0S17 |
    										GPIO_PCTL_PJ2_EPI0S18 |
    										GPIO_PCTL_PJ3_EPI0S19 ;
}

void customResetISR(void){
    EPI_Init();
    return;
}
void customStartFunction(void){
    EPI_Init();
    return;
}

Those two functions are configured in main.cfg, and are called before main as expected (verified with breakpoints) :
    Startup.resetFxn = "&customResetISR";
    var len = Startup.firstFxns.length
    Startup.firstFxns.length++;
    Startup.firstFxns[len] = '&customStartFunction';

The problem occurs when I try to put .bss section in ARM_EXTRAM. I obtain the following message "Memory map prevented reading 0x601F1E1C":

After looking into it it seems this error occurs with BIOS_start().
I tried to manipulate the memory in the beginning of main with the following code and it doesn't raise any error:
    short *MemLoc = (short *)(0x601F1E1C);
    *MemLoc = 1234;

To summarize, accessing the external SRAM works fine with other sections than .bss, and EPI is initialized with XDC reset and startup functions so supposedly before .bss initialization with zeros.

Could you please tell me if I missed a step in EPI initialization, which would make the BIOS_start() fail ?

Thank you in advance for your help.
Yours Sincerely,
Paul Noalhyt

  • Hi Paul,

    I am a little confused; is BIOS_start() failing? Is your application crashing? Is it that the debug window states "Memory map prevented reading..."? I just want to make sure I understand your issue.

    Best,
    -- Emmanuel
  • Hi Emmanuel,
    Thank you for your quick reply.

    Yes when I try to put .bss in external memory the application is crashing, giving me the "Memory map prevented reading..." error message in debug console:

    After investigating with breakpoints I found the following execution, after a reset :
    - customResetISR is called
    - customStartFunction is called
    - going into main
        -> when executing BIOS_start(), I get the "Memory map prevented reading..." message with abort() and loader_exit() functions, as you can see in the screenshot

    Thank you for your help.
    Best regards,
    Paul

  • Hi Paul,

    The error you are seeing in the debug window is because CCS is not aware of the external memory. You can update the CCS Gel file (memory map used by CCS when accessing device) by doing the following:

    1. Launch the debug session.
    2. In the toolbar select: Tools->Gel Files.
    3. A window will pop up.  Double click the f28m35h52c1_m3.gel file.
    4. In the F28M35H52C1_Memory_Map() function add an entry for external memory.

    Let me know if this helps,

    -- Emmanuel

  • Hi Emmanuel,

    Thank you, this advice solved  the "Memory map prevented reading..." message ! As you can see, we can now access the external memory with the CCS Debug Disassembly window.

    Although not everything is solved, as you can see in the screenshot below:

    Do you know how can I know what caused the xdc to abort ? Because as it is now, the call stack is not very helpful.

    From what I understand the CIO system calls are used by the debugger to read/write data in memory.
    But the CIO section is mapped that way :
        .cio        : > C03SRAM     with C03SRAM being the ARM RAM (C03SRAM (RWX)           : origin = 0x20000000, length = 0x8000)

    And as I said before, everything was working fine until I put .bss in external memory.
    Do you have any advice ?

    Thank you for your help.
    Best regards,
    Paul

  • Glad to hear there is some progress. I'm going to consult a colleague about the final CIO command warning.

    In the meantime lets try to figure out what is causing the BIOS_exit(). Can you post ROV screenshots of: BIOS->Scan for Errors, Hwi->Exceptions, & SysMin. These can help give us a clue of what is going on. Also, can you post what is located in 0x002618F2 (the address that caused the crash)?

    Thanks,
    -- Emmanuel
  • Emmanuel Trinidad - Alicea said:
    I'm going to consult a colleague about the final CIO command warning.

    In the linker command file, make sure the .cio section is in valid read/write memory.  This tip, and many more like it, are from the article Tips on using printf.

    Thanks and regards,

    -George

  • Hello,

    Thank both of you for helping me solve this issue.

    To answer you Emmanuel, here are the screenshots you asked for:

    • BIOS->Scan for Errors:

    • Hwi->Exceptions (No data to display here)

    • SysMin

    Here is also a txt file containing all the information listed in the Raw tab of SysMin:

    SysMin_Raw.txt
    Module State,
    	outbuf$fetchDesc,
    		type,xdc.rov.support.ScalarStructs.S_Char
    		isScalar,true
    	$addr,0x200084c0
    	$type,xdc.runtime.SysMin.Module_State
    	outbuf,0x601f875c
    	outidx,0
    	wrapped,0
    	Instance States,
    Configuration,
    	$instances,
    		$category,Vector
    		$name,xdc.runtime.SysMin/$instances
    	common$,
    		gate,
    			$module,
    				$instances,
    					0,ROV reached max depth (5)
    					$category,Vector
    					$name,ti.sysbios.gates.GateHwi/$instances
    				common$,
    					$category,Struct
    					$name,ti.sysbios.gates.GateHwi/common$
    					diags_ANALYSIS,xdc.runtime.Diags.ALWAYS_OFF
    					diags_ASSERT,xdc.runtime.Diags.ALWAYS_ON
    					diags_ENTRY,xdc.runtime.Diags.ALWAYS_OFF
    					diags_EXIT,xdc.runtime.Diags.ALWAYS_OFF
    					diags_INFO,xdc.runtime.Diags.ALWAYS_OFF
    					diags_INTERNAL,xdc.runtime.Diags.ALWAYS_OFF
    					diags_LIFECYCLE,xdc.runtime.Diags.ALWAYS_OFF
    					diags_STATUS,xdc.runtime.Diags.ALWAYS_ON
    					diags_USER1,xdc.runtime.Diags.ALWAYS_OFF
    					diags_USER2,xdc.runtime.Diags.ALWAYS_OFF
    					diags_USER3,xdc.runtime.Diags.ALWAYS_OFF
    					diags_USER4,xdc.runtime.Diags.ALWAYS_OFF
    					diags_USER5,xdc.runtime.Diags.ALWAYS_OFF
    					diags_USER6,xdc.runtime.Diags.ALWAYS_OFF
    					diags_USER7,xdc.runtime.Diags.ALWAYS_OFF
    					diags_USER8,xdc.runtime.Diags.ALWAYS_OFF
    					fxntab,true
    					gate,ROV reached max depth (5)
    					gateParams,null
    					instanceHeap,null
    					instanceSection,null
    					logger,null
    					memoryPolicy,xdc.runtime.Types.DELETE_POLICY
    					namedInstance,false
    					namedModule,true
    					romPatchTable,false
    				configNameMap$,
    					0,ROV reached max depth (5)
    					1,ROV reached max depth (5)
    					2,ROV reached max depth (5)
    					3,ROV reached max depth (5)
    					4,ROV reached max depth (5)
    					5,ROV reached max depth (5)
    					$keys,ROV reached max depth (5)
    					xdc.runtime/Memory,ROV reached max depth (5)
    					xdc.runtime/Diagnostics,ROV reached max depth (5)
    					xdc.runtime/Concurrency,ROV reached max depth (5)
    					xdc.runtime/Log Events,ROV reached max depth (5)
    					xdc.runtime/Asserts,ROV reached max depth (5)
    					xdc.runtime/Errors,ROV reached max depth (5)
    					$category,Map
    					$name,ti.sysbios.gates.GateHwi/configNameMap$
    				rovViewInfo,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#21
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				viewNameMap$,
    					$keys,ROV reached max depth (5)
    					$category,Map
    					$name,ti.sysbios.gates.GateHwi/viewNameMap$
    				$category,Module
    				$name,ti.sysbios.gates.GateHwi
    				Module__diagsEnabled,144
    				Module__diagsIncluded,144
    				Module__diagsMask,null
    				Module__gateObj,null
    				Module__gatePrms,null
    				Module__id,32806
    				Module__loggerDefined,false
    				Module__loggerFxn0,null
    				Module__loggerFxn1,null
    				Module__loggerFxn2,null
    				Module__loggerFxn4,null
    				Module__loggerFxn8,null
    				Module__loggerObj,null
    				Module__startupDoneFxn,null
    				Object__count,0
    				Object__heap,null
    				Object__sizeof,0
    				Object__table,null
    				Q_BLOCKING,1
    				Q_PREEMPTING,2
    				rovShowRawTab$,true
    			instance,
    				$category,Struct
    				$name,ti.sysbios.gates.GateHwi.Instance#0/instance
    				name,null
    			$category,Instance
    			$name,ti.sysbios.gates.GateHwi.Instance#0
    			Q_BLOCKING,1
    			Q_PREEMPTING,2
    		$category,Struct
    		$name,xdc.runtime.SysMin/common$
    		diags_ANALYSIS,xdc.runtime.Diags.ALWAYS_OFF
    		diags_ASSERT,xdc.runtime.Diags.ALWAYS_ON
    		diags_ENTRY,xdc.runtime.Diags.ALWAYS_OFF
    		diags_EXIT,xdc.runtime.Diags.ALWAYS_OFF
    		diags_INFO,xdc.runtime.Diags.ALWAYS_OFF
    		diags_INTERNAL,xdc.runtime.Diags.ALWAYS_OFF
    		diags_LIFECYCLE,xdc.runtime.Diags.ALWAYS_OFF
    		diags_STATUS,xdc.runtime.Diags.ALWAYS_OFF
    		diags_USER1,xdc.runtime.Diags.ALWAYS_OFF
    		diags_USER2,xdc.runtime.Diags.ALWAYS_OFF
    		diags_USER3,xdc.runtime.Diags.ALWAYS_OFF
    		diags_USER4,xdc.runtime.Diags.ALWAYS_OFF
    		diags_USER5,xdc.runtime.Diags.ALWAYS_OFF
    		diags_USER6,xdc.runtime.Diags.ALWAYS_OFF
    		diags_USER7,xdc.runtime.Diags.ALWAYS_OFF
    		diags_USER8,xdc.runtime.Diags.ALWAYS_OFF
    		fxntab,true
    		gateParams,null
    		instanceHeap,null
    		instanceSection,null
    		logger,null
    		memoryPolicy,xdc.runtime.Types.DELETE_POLICY
    		namedInstance,false
    		namedModule,true
    		romPatchTable,false
    	configNameMap$,
    		0,
    			fields,
    				0,common$.instanceHeap
    				1,common$.instanceSection
    				2,common$.memoryPolicy
    				3,common$.namedModule
    				4,common$.namedInstance
    				5,common$.fxntab
    				6,common$.romPatchTable
    				$category,Vector
    				$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Memory'/fields
    			$category,Struct
    			$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Memory'
    			viewFxn,undefined
    			viewType,module
    		1,
    			fields,
    				0,common$.logger
    				1,common$.diags_ASSERT
    				2,common$.diags_ENTRY
    				3,common$.diags_EXIT
    				4,common$.diags_INTERNAL
    				5,common$.diags_LIFECYCLE
    				6,common$.diags_STATUS
    				7,common$.diags_USER1
    				8,common$.diags_USER2
    				9,common$.diags_USER3
    				10,common$.diags_USER4
    				11,common$.diags_USER5
    				12,common$.diags_USER6
    				13,common$.diags_INFO
    				14,common$.diags_ANALYSIS
    				$category,Vector
    				$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Diagnostics'/fields
    			$category,Struct
    			$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Diagnostics'
    			viewFxn,undefined
    			viewType,module
    		2,
    			fields,
    					0,common$.gate
    					1,common$.gateParams
    					$category,Vector
    					$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Concurrency'/fields
    			$category,Struct
    			$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Concurrency'
    			viewFxn,undefined
    			viewType,module
    		3,
    			fields,
    				0,Log.Event
    				$category,Vector
    				$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Log Events'/fields
    			$category,Struct
    			$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Log Events'
    			viewFxn,undefined
    			viewType,instance
    		4,
    			fields,
    				0,Assert.Id
    				$category,Vector
    				$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Asserts'/fields
    			$category,Struct
    			$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Asserts'
    			viewFxn,undefined
    			viewType,instance
    		5,
    			fields,
    				0,Error.Id
    				$category,Vector
    				$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Errors'/fields
    			$category,Struct
    			$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Errors'
    			viewFxn,undefined
    			viewType,instance
    		$keys,
    			0,xdc.runtime/Memory
    			1,xdc.runtime/Diagnostics
    			2,xdc.runtime/Concurrency
    			3,xdc.runtime/Log Events
    			4,xdc.runtime/Asserts
    			5,xdc.runtime/Errors
    		xdc.runtime/Memory,
    			fields,
    				0,common$.instanceHeap
    				1,common$.instanceSection
    				2,common$.memoryPolicy
    				3,common$.namedModule
    				4,common$.namedInstance
    				5,common$.fxntab
    				6,common$.romPatchTable
    				$category,Vector
    				$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Memory'/fields
    			$category,Struct
    			$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Memory'
    			viewFxn,undefined
    			viewType,module
    		xdc.runtime/Diagnostics,
    			fields,
    				0,common$.logger
    				1,common$.diags_ASSERT
    				2,common$.diags_ENTRY
    				3,common$.diags_EXIT
    				4,common$.diags_INTERNAL
    				5,common$.diags_LIFECYCLE
    				6,common$.diags_STATUS
    				7,common$.diags_USER1
    				8,common$.diags_USER2
    				9,common$.diags_USER3
    				10,common$.diags_USER4
    				11,common$.diags_USER5
    				12,common$.diags_USER6
    				13,common$.diags_INFO
    				14,common$.diags_ANALYSIS
    				$category,Vector
    				$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Diagnostics'/fields
    			$category,Struct
    			$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Diagnostics'
    			viewFxn,undefined
    			viewType,module
    		xdc.runtime/Concurrency,
    			fields,
    				0,common$.gate
    				1,common$.gateParams
    				$category,Vector
    				$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Concurrency'/fields
    			$category,Struct
    			$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Concurrency'
    			viewFxn,undefined
    			viewType,module
    		xdc.runtime/Log Events,
    			fields,
    				0,Log.Event
    				$category,Vector
    				$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Log Events'/fields
    			$category,Struct
    			$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Log Events'
    			viewFxn,undefined
    			viewType,instance
    		xdc.runtime/Asserts,
    			fields,
    				0,Assert.Id
    				$category,Vector
    				$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Asserts'/fields
    			$category,Struct
    			$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Asserts'
    			viewFxn,undefined
    			viewType,instance
    		xdc.runtime/Errors,
    			fields,
    				0,Error.Id
    				$category,Vector
    				$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Errors'/fields
    			$category,Struct
    			$name,xdc.runtime.SysMin/configNameMap$/'xdc.runtime/Errors'
    			viewFxn,undefined
    			viewType,instance
    		$category,Map
    		$name,xdc.runtime.SysMin/configNameMap$
    	rovViewInfo,
    		$module,
    			$instances,
    				0,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#0
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				1,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#1
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				2,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#2
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				3,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#3
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				4,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#4
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				5,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#5
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				6,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#6
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				7,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#7
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				8,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#8
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				9,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#9
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				10,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#10
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				11,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#11
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				12,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#12
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				13,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#13
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				14,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#14
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				15,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#15
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				16,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#16
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				17,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#17
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				18,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#18
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				19,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#19
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				20,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#20
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				21,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#21
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				22,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#22
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				23,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#23
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				24,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#24
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				25,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#25
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				26,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#26
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				27,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#27
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				28,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#28
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				29,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#29
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				30,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#30
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				31,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#31
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				32,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#32
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				33,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#33
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				34,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#34
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				35,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#35
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				36,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#36
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				37,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#37
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				38,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#38
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				39,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#39
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				40,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#40
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				41,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#41
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				42,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#42
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				43,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#43
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				44,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#44
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				45,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#45
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				46,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#46
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				47,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#47
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				48,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#48
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				49,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#49
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				50,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#50
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				51,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#51
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				52,
    					$category,Instance
    					$module,ROV reached max depth (5)
    					$name,xdc.rov.ViewInfo.Instance#52
    					showRawTab,true
    					viewMap,ROV reached max depth (5)
    				$category,Vector
    				$name,xdc.rov.ViewInfo/$instances
    			$category,Module
    			$name,xdc.rov.ViewInfo
    		viewMap,
    			0,
    				$category,Struct
    				$name,xdc.rov.ViewInfo.Instance#5/viewMap/'Module'
    				structName,ModuleView
    				type,xdc.rov.ViewInfo.MODULE
    				viewInitFxn,viewInitModule
    			1,
    				$category,Struct
    				$name,xdc.rov.ViewInfo.Instance#5/viewMap/'OutputBuffer'
    				structName,BufferEntryView
    				type,xdc.rov.ViewInfo.MODULE_DATA
    				viewInitFxn,viewInitOutputBuffer
    			$keys,
    				0,Module
    				1,OutputBuffer
    			Module,
    				$category,Struct
    				$name,xdc.rov.ViewInfo.Instance#5/viewMap/'Module'
    				structName,ModuleView
    				type,xdc.rov.ViewInfo.MODULE
    				viewInitFxn,viewInitModule
    			OutputBuffer,
    				$category,Struct
    				$name,xdc.rov.ViewInfo.Instance#5/viewMap/'OutputBuffer'
    				structName,BufferEntryView
    				type,xdc.rov.ViewInfo.MODULE_DATA
    				viewInitFxn,viewInitOutputBuffer
    			$category,Map
    			$name,xdc.rov.ViewInfo.Instance#5/viewMap
    		$category,Instance
    		$name,xdc.rov.ViewInfo.Instance#5
    		showRawTab,true
    	viewNameMap$,
    		$keys,
    		$category,Map
    		$name,xdc.runtime.SysMin/viewNameMap$
    	$category,Module
    	$name,xdc.runtime.SysMin
    	Module__diagsEnabled,16
    	Module__diagsIncluded,16
    	Module__diagsMask,null
    	Module__gateObj,null
    	Module__gatePrms,null
    	Module__id,32782
    	Module__loggerDefined,false
    	Module__loggerFxn0,null
    	Module__loggerFxn1,null
    	Module__loggerFxn2,null
    	Module__loggerFxn4,null
    	Module__loggerFxn8,null
    	Module__loggerObj,null
    	Module__startupDoneFxn,null
    	Object__count,0
    	Object__heap,null
    	Object__sizeof,0
    	Object__table,null
    	bufSize,256
    	flushAtExit,true
    	outputFunc,&xdc_runtime_SysMin_output__I
    	outputFxn,null
    	rovShowRawTab$,true
    	sectionName,null
    

    And finally as screenshot of what is at address 0x002618F2, which seems to execute a stack check and rise an error if any issue is encountered :

    To answer you George

    I did not move the .cio section, which is, as I mentioned in my previous post, declared that way:
    .cio        : > C03SRAM     with C03SRAM being the ARM RAM (C03SRAM (RWX)           : origin = 0x20000000, length = 0x8000)

    I am only trying to move the .bss section in external memory. Before I tried to do that everything was working perfectly.
    Although the thing I do not understand is that I get the error "Invalid CIO command (0) in the CIO buffer at address (0x601f841c) was not recognized" which is in external memory, but the CIO section is located in internal ARM memory (between 0x20000000 and 0x20008000), so what is the CIO buffer doing in external memory ?

    Thank you again for your help.
    Best regards,
    Paul

  • Hi Paul,

    Unfortunately, your screenshots did not load correctly.  Can you please reload them to this post?  Can you post the "Output Buffer" tab of SysMin?

    Thanks for the disassembly window; can you scroll up slowly to the next function call (so we can see which function we are in)?  

    Thanks,

    -- Emmanuel

  • Hi Emmanuel,

    Yes indeed, I don't know what happened. Here they are:

    BIOS->Scan for Errors:

    Hwi->Exceptions (No data to display here)

    SysMin

    SysMin->OutputBuffer (No data to display here)

    Here is a more detailed assembly view:

    I hope this is what you want, we seem to be in the ti_sysbios_knl_Task_checkStacks__E.

    Thank you for your help.
    Best regards,
    Paul

  • Hi,

    Did you have time to take a look at my problem ? Can you please propose a solution ?

    Best regards,
    Paul
  • It looks like either your Task stacks are too small or there was corruption in the Task Object list. Can you look at ROV->Tasks->Detailed right before BIOS_start to see how big the task stacks are? Then after you hit the error case, take a look at.

    Here's a video/presentation on stack usage: training.ti.com/debugging-common-application-issues-ti-rtos

    Todd
  • Hi Todd,

    Here is ROV->Tasks->Detailed before BIOS_start:

    And after the error:

    The weird thing is that everything works fine when I assign .bss to internal RAM. So the task sizes are good I thing. It is a matter of internal VS external RAM in my opinion.

    Thank you.
    Best regards,
    Paul Noalhyt

  • In the meantime I found out something that might be the cause of the error.

    The external RAM I am using is composed of 1,048,576 words of 16 bits. I configured it using EPI 16-Bit Host Bus (HB-16) Mode, without Byte Selects.
    That means that the smallest data I can read or write is a word of 16 bits.

    I made a simple test that writes a single byte at address 0x60000000 and then write an other byte at 0x60000001.
    The result is the following:

    • Write 0x12 at 0x60000000 then in memory we have : 0x60000000 = 0x12 and 0x60000001 = 0x00
    • Write 0x34 at 0x60000001 then in memory we have : 0x60000000 = 0x00 and 0x60000001 = 0x34

    So I noticed that writing a single byte is not possible, as it overwrites the entire word. The solution to this problem is to use the UpperByte and LowerByte pins of the RAM chip (see below) and configure EPI 16-Bit Host Bus (HB-16) Mode With Byte Selects.

    Pins and diagram of the RAM chip :

    The thing is that our board is routed with LB and UB connected to ground, and we cannot modify the hardware at the moment:

    Considering all this, will it be impossible to access individual bytes in the external RAM ? Or is there a workaround ?

    Will it be impossible to place .bss in external memory ?

    Thank you.
    Best regards,
    Paul Noalhyt

  • Paul,

    There is no way to get around the loss of byte-addressability without remapping the UB/LB signals.

    The only software workaround I can think of would be to only use variables that are sized as multiples of 16 bits, but there may be some special handling required to guarantee that the variables are byte-aligned. I'm not very familiar with this aspect.

    -Tommy
  • Paul,

    With that memory configuration, you cannot put .bss there. I see one issue immediately...task stacks. The kernel initializes the stack to 0xbe. For example, here is a task with the first bytes already used (stack grows to higher addresses) in internal RAM on a 28379D device.


    #define STACK_INIT_VAL 0xbe

    Ptr TaskSupport_start(Ptr currTsk, ITaskSupport_FuncPtr enter,
    ITaskSupport_FuncPtr exit, Error_Block *eb)
    {
        Ptr sp;
        UInt size;
        Char *sptr;
        Task_Object *tsk = (Task_Object *)(currTsk);

        ....

        if (Task_initStackFlag) {

            sptr = (Char *)tsk->stack;
            size = tsk->stackSize;
            while (size--) {
                *sptr++ = STACK_INIT_VAL;
            }
        }

    Of course you could disable the initialization of the stack, but I'm sure there will be other issues.

    Todd

  • Hi Todd and Tommy,

    This answer is disappointing that is what I feared.
    Thank you for your help.

    Bests,
    Paul