160 likes | 175 Views
Comprehensive guide for debugging and training in embedded systems featuring memory settings, initialization scripts, and debugging procedures with GNU and Green Hills debuggers. Learn how to optimize SDRAM and flash memory configurations.
E N D
NET+OS 6.1 Training NetSilicon & Digi Confidential
Debugging NetSilicon & Digi Confidential
SDRAM Memory settings • Settings.s contains the memory controller register settings for SDRAM. (not in debugger) • If you use different memory parts you must modify this file (PC133). • RAS and CAS Delay Registers • Dynamic memory configuration registers NetSilicon & Digi Confidential
SRAM (flash) • Table defined in bsp.c defines the register settings for SRAM parts • SRAM memory configuration registers, specifies 16 bit or 32-bit. • Static memory Read Delay registers NetSilicon & Digi Confidential
Remember…. • To modify defines in bsp.h to enable drivers • We now have four serial ports, two are UART and one is SPI and one is not connected. • The boards default to support USB host • Only big endian is supported • There is no EEPROM support for NVRAM NetSilicon & Digi Confidential
Using the Majic Debugger • Initialization Script • JTAG Reset Issue • Debugging with GDB • Debugging with Green Hills NetSilicon & Digi Confidential
Initialization Script • The debugger initialization file is called ns9750_a.cmd • Initializes SDRAM on CS4 • For different types of SDRAM you will have to modify this script • Sets a bit in an SCM register to tell the code that we are in the debugger • Same script works for GNU and Green Hills NetSilicon & Digi Confidential
Initialization Script • Uses monitor commands to read and write registers. • These commands are described in the EPI documentation provided with NET+OS • Sets up the memory controller registers which are described in the HW reference guide NetSilicon & Digi Confidential
Monitor commands • Monitor commands can be used in the MONICE low level debugger • The MONICE debugger is helpful in board bring up, allows you to read/write memory and has built in memory test. • You can create an icon for the MONICE debugger using the majic setup wizard • ew = enter word, dw = display word NetSilicon & Digi Confidential
Initialization: (cont) • // • // Minimal memory controller initialization--just enough to allow code • // to be downloaded. Boot code will do the rest. • // • ew 0xA0700000 = 0x00000001 // Enable the memory controller. • ew 0xA0700024 = 0x00000006 // Set the refresh counter, 60 is optimal, 30 is safer for now • ew 0xA0700028 = 0x00000001 // • ew 0xA0700030 = 0x00000001 // Set the precharge period • ew 0xA0700034 = 0x00000004 // Active to precharge command period is 16 clock cycles • ew 0xA070003C = 0x00000001 // tAPR • ew 0xA0700040 = 0x00000005 // tDAL • ew 0xA0700044 = 0x00000001 // tWR • ew 0xA0700048 = 0x00000006 // tRC 32 clock cycles • ew 0xA070004C = 0x00000006 // tRFC 32 clock cycles NetSilicon & Digi Confidential
Using the majic with GNU • All debugger files are setup by the majic setup wizzard • Epimdi.cfg - Contains the units IP address - processor type and endianess - This file should not have to modified • Startice.cmd - You do not have to modify this file - Contains JTAG configuration commands • ns9750_a.cmd - SDRAM initialization commands NetSilicon & Digi Confidential
JTAG Reset Issue • Cannot run the debugger if there is code in flash (runs unstable) • We don’t have a fix for this yet. • Fixed in the next version of Mercury • Before you power on the board you need to put jumper J1 ON if there is code in flash • Once you start the debugger you can remove JI, this is error prone. You need to remove this jumper before you access flash (NVRAM) NetSilicon & Digi Confidential
GNU Debugging (Cont) • In your applications 32b directory “make gdbinit” This will create a .gdbinit file in your 32b directory. You only need to do this once. The .gdinit file is the initialization file for gdb. And contains the monitor load command. • Type “xtools arm-elf” to specify the processor type NetSilicon & Digi Confidential
GNU Debugging • Put J1 on if there is code in flash • Power on the board • Type gdbtk –se image.elf, the code will start downloading to the board • Remove J1, if you need to access flash • You are now ready to debug. NetSilicon & Digi Confidential
Debugging with GHS • Debugger files are located in /ghs/arm361 and are setup by the installer • rdimajic.cfg - IP address - Processor type, endian • startice.cmd and ns9750_a.cmd, same as GNU • Put J1 on if necessary and Power on board • Start multi and build your application NetSilicon & Digi Confidential
Debugging with GHS (cont) • Click on download to target • rdiserv –ice –nobss –big • You can remove the jumper once the code starts to download, if you need to access flash. • You can now start debugging NetSilicon & Digi Confidential