On 10 March 2012 20:28, salvador <salva...@telecable.es> wrote: > On 03/08/2012 04:48 PM, Spencer Oliver wrote: > > On 7 March 2012 08:07, salvador <salva...@telecable.es> wrote: > > Hello, > > after reading and looking at the examples in this data sheet: PIC32MX > Section 3. Memory Organization > > http://ww1.microchip.com/downloads/en/DeviceDoc/61115F.pdf > > i think the settings in pic32mx.cfg are wrong, but ... > > Suppose we have 16K of RAM. ( _WORKAREASIZE 0x4000). > > set _PIC32MX_DATASIZE > 0x800 > 2K > set _PIC32MX_PROGSIZE [expr ($_WORKAREASIZE - > $_PIC32MX_DATASIZE)] 14K > > > # BMXDKPBA: 2k kernel data @ 0xa0000800 > mww 0xbf882010 $_PIC32MX_DATASIZE > > OK: 2k kernel data from 0xa0000000 to 0xa0000800 > > > # BMXDUDBA: 16k kernel program @ 0xa0000800 > mww 0xbf882020 $_PIC32MX_PROGSIZE > Why not 16K (_WORKAREASIZE)? > > because we cannot use the first 2k (by design). > BMXDKPBA<10:0> are read only and always read as zero. > > Sorry: BMXDUDBA: Relative Base Address in the DRM, for User mode data space > in RAM > > You can find examples in the data sheet where BMXDUDBA=BMXDRMSZ > > Please take a look at: Example 2. RAM Partitioned as Kernel Data and Kernel > Program > in page 25 of the above data sheet (Memory organization). > > > Now we have kernel program memory from 2k to 14k and from 14k to 16k in > user space 2k. > Kernel program memory starts at 0xa0000800. Size 12k. > > # BMXDUPBA: 0k user program > mww 0xbf882030 $_PIC32MX_PROGSIZE > Why not 16K (_WORKAREASIZE)? > > Now we have 2k user program memory, and 0k user data memory. > > user program memory size is defined as BMXDUPBA - BMXDUDBA > > Sorry: User program memory size is defined as BMXDRMSZ - BMXDUPBA. (2Kb ) > > BMXDUPBA - BMXDUDBA is the user data memory size. (0Kb) > > > > $_TARGETNAME configure -work-area-phys 0xa0000800 -work-area-size > $_PIC32MX_PROGSIZE -work-area-backup 0 > > We set -work-area-size to 14K but we have only 12k. > > > At first glance, with actual driver code, this is not a problem if we have > 16k RAM or more memory. But with 8k or 4k probably it will not work. > For example with 4K RAM we end up setting -work-area-size to 2K but there is > no kernel program memory at all. > > I am wrong? > > Thanks, Salvador. > > It has been a while, however looking at the cfg again the only issue i > see are typo's. > > 1. kernel data is 2k but should start @ 0xa0000000 not 0xa0000800. > 2. kernel data should say 14k not 16k > > I will commit a patch for the above. > > Cheers > Spen > > Sorry, i think this is a better reply. >
Salvador, I am sorry but i do not understand what you are trying to say. The code in the pic32 config was basically taken from that example. Cheers Spen ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ OpenOCD-devel mailing list OpenOCD-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openocd-devel