Hi,
I had a confusing failure. I am using Linux based command line jlink server for a at91m4800 arm7tdmi soc.
Here is what the server says when staring up:
Display All
And then I use command line gdb:
The debugger works ok, but cannot flash the second 8k page in the nor flash. I use 2 bootstrap 8k sectors and then the main program starts at the first 64K segment.
The failure is gdb cannot erase the page. If I use the windows jlink tool I can erase the device and then load the program. So it can write, but not erase. I am telling gdb that it is a cfi flash so it should know the layout of the flash.
Here is my .gdbinit:
Display All
I use the gdb "load" command to load a file into flash. It fails every time to erase the second page of flash in the bootstrap. Is this a known problem?
I had a confusing failure. I am using Linux based command line jlink server for a at91m4800 arm7tdmi soc.
Here is what the server says when staring up:
Source Code
- SEGGER J-Link GDB Server V6.32 Command Line Version
- JLinkARM.dll V6.32 (DLL compiled Apr 20 2018 17:34:47)
- Command line: -device AT91M40800 -scriptfile /opt/SEGGER/JLink/Devices/ATMEL/AT91M40800.JLinkScript
- -----GDB Server start settings-----
- GDBInit file: none
- GDB Server Listening port: 2331
- SWO raw output listening port: 2332
- Terminal I/O port: 2333
- Accept remote connection: yes
- Generate logfile: off
- Verify download: off
- Init regs on start: off
- Silent mode: off
- Single run mode: off
- Target connection timeout: 0 ms
- ------J-Link related settings------
- J-Link Host interface: USB
- J-Link script: /opt/SEGGER/JLink/Devices/ATMEL/AT91M40800.JLinkScript
- J-Link settings file: none
- ------Target related settings------
- Target device: AT91M40800
- Target interface: JTAG
- Target interface speed: 4000kHz
- Target endian: little
And then I use command line gdb:
The debugger works ok, but cannot flash the second 8k page in the nor flash. I use 2 bootstrap 8k sectors and then the main program starts at the first 64K segment.
The failure is gdb cannot erase the page. If I use the windows jlink tool I can erase the device and then load the program. So it can write, but not erase. I am telling gdb that it is a cfi flash so it should know the layout of the flash.
Here is my .gdbinit:
Source Code
- set auto-load safe-path /
- # Connect to the GDB Server
- target extended-remote :2331
- file thumb/hlm_flash.elf
- monitor reset
- monitor halt
- monitor endian little
- monitor speed auto
- monitor flash device mx29lv320e
- #Cancel reset remapping
- set *((int *) 0xFFE00020) = 0x00000001
- #//enable A0..A21
- set *((int *) 0xFFE00024) = 0x00000005
- #CS0 @ 0x1000000
- set *((int *) 0xFFE00000) = 0x0100253D
- #RAM at 0x02000000
- set *((int *) 0xFFE00004) = 0x02002121
- #CAN at 0x03000000
- set *((int *) 0xFFE00008) = 0x0300252E
- #ispLSI at 0x04000000
- set *((int *) 0xFFE0000C) = 0x0400252E
- #disable all interrupts
- set *((int *) 0xFFFFF124) = 0xFFFFFFFF
- #Enable, EBI_MCR: ALE, DRP
- set *((int *) 0xFFE00024) = 0x00000006
- #Remap Command is this needed again?
- set *((int *) 0xFFE00020) = 0x00000001
- monitor flash breakpoints = 1
- monitor workram = 0x00000000-0x00001FFF
- monitor flash cfi 0x01000000-0x013FFFFF
- monitor reg pc = 0x1004448
- set $pc=0x1004448
- set input-radix 0x10
- set output-radix 0x10
- set disassemble-next-line on