duane>> [[ started this: about creating a memory range to determine 
breakpoints, because CortexM macro is wrong headed ]]

Freddie>> [[ points out using the flash memory area … ]]

duane>> [ That means the target has to be probed - cannot always probe ]
duane>> [ Not all targets have a “flash driver” so they cannot be probed ]

Andreas>> [ Points out that most ‘workspaces’ cover all RAM, and this is a 
configuration option ]

duane>> [ points out there are many types of memory maps - that are not 
probable, not just work areas]

So - my new proposal is this:

What if we create a command:

  $_TARGET  memmap   SHOW
       print a nice table

  $_TARGET  memmap   CLEAR
       set entire range as NOTPRESENT

  $_TARGET  memmap   INSERT   TYPE START LENGTH
       Insert a new range with specific type

Where  TYPE = 
        RAM  = generic ram

        Should this support suffixes?

        RAM.8 = ram accessible in 8bit mode only
        RAM.16  - 16 bit mode only
        RAM.32

        ROM < and suffixes >
        FLASH <and suffixes >
        HWREGS <and suffixes>
        NOTPRESENT

The target defaults will be:
        ALL of memory = RAM
         (when the target structure is allocated and initialized)

For Cortex M, there will be a default range 
        My changes will support this.
        Done in the arch init code

Other targets [I’m not going to do this, others can]
        Option 1:   During their arch init - can modify the map  
        Option 2:  After flash probe occurs can modify the map

        Flash drivers - once probing is complete they can choose to call the 
mmap functions below.

Not sure - should the “work areas” modify the target memmap?
        I don’t think so - because by default those areas would by default 
already be marked as RAM       


new types:   
   enum   MEM_RANGE_TYPE  /* per above */
   struct   target_mem_range  /* details below */

   /* this is a longer term issue that needs to be started */
   typedef uint64_t  target_addres_t;  /* think 64bit arch!!!! */

new functions with this signature:

    BKPT_TYPE   target_breakpoint_by_address( target,  address )
    (replacing the cortex_m macro that caused this mess)

     BKPT_TYPE = ram - for any ram type thing
     BLPT_HARD = all otters

New functions:

     /* set all to not present */
     target_mmap_clear( target ); 
     
     /* split current map and insert this new map */     
     target_mmap_insert( target,  TYPE,  START, LENGTH )

implementation will be an array of:

      /* pointer to array of this in the target structure */   
      struct  target_mmap_range {
            enum RAMTYPE   type;
            target_addr_t         start;
            target_off_t            len;
      };

      /* and this in the target structure */
      int  n_target_mmaps;

Thoughts??


------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to