Hi guys. Its been a while since I've posted, yet I still browse the forums daily.
I'm working on an STM320F103E project which interfaces with an FPGA via memory mapping.
The code is functional, but 'for some reason' the processor is accessing memory at 0x68008000 and at 0x6800A000 as observed in ChipScope within the Xilinx FPGA.
As you know by now, I really hate not knowing everything that my code is doing, so this really upsets me.
Although the interface to the FPGA is in BANK3 at 0x68018000 & 0x68018002, the code is accessing memory that I don't know about or remember yet.
All of this code works. (No problems here) I just wanted to share the basic access performed: I don't read/write externally anywhere else (that I know) typedef volatile unsigned int vu16; typedef volatile unsigned long vu32; typedef unsigned long u32; #define BANK3_PSRAM ( (vu32)0x68000000 ) // 0x6800.0000-0x68FF.FFFF #define FPGA_BASE_ADDRESS ( BANK3_PSRAM + 0x00000000 ) // FPGA mapped base #define FPGA_ROTARY_DIRECT_DATA_LSW *( (vu32 *) (u32) ( FPGA_BASE_ADDRESS + 0x00018000 ) ) #define FPGA_ROTARY_DIRECT_DATA_MSW *( (vu32 *) (u32) ( FPGA_BASE_ADDRESS + 0x00018002 ) ) vu32 The_Encoder_Value; // 'global' for testing void FPGA_Test_RW( void ) // redacted routine for this post { vu16 rotary_encoder_lsw; // 16-bit external access to FPGA (least significant word) vu16 rotary_encoder_msw; // 16-bit external access to FPGA (most significant word) rotary_encoder_lsw = FPGA_ROTARY_DIRECT_DATA_LSW; rotary_encoder_msw = FPGA_ROTARY_DIRECT_DATA_MSW; The_Encoder_Value = ( ((u32) rotary_encoder_msw)<<16 ) | rotary_encoder_lsw; }
I'd like to set a break point on writing or reading to/from 0x68008000 & 0x6800A000, but the Expression Help doesn't explain the syntax well enough.
Yes, I did a 'little' research first, but decided to ask the forum how to do this, or better yet, provide a link that explains the Expression syntax better.
--Cpt. Vince Foster 2nd Cannon Place Fort Marcy Park, VA
This should do the trick - in the debugger command window, enter:
bs readwrite *((int *) 0x68008000) bs readwrite *((int *) 0x6800A000) bl // list the current breakpoints
With the cast around the address constant, the access size is specified (4 in this case). You might change this to 'short *' or 'char *' to specify the access size to be 2 or 1. You might also open the breakpoint dialog and look how the above breakpoints are translated and shown - just as a reference...
Thanks Gp F !
It worked. You nailed it.
I had to enter it via command-line, and not the Breakpoints Dialog box. (It shows up in the dialog box after the command-line command is entered).
Yup, it turns out that some "temporary" diagnostic code was still burried in one of my isr routines when I first started interfacing with the FPGA at 0x68008000 / 0x6800A000.
Problem solved. Thanks again.