Freddie Chopin wrote:

freddie> I still cannot agree on that. Which version is better:
freddie> Your:

duane> global CHIPNAME
duane> set CHIPNAME lpc2103
duane> global FLASH_SIZE
duane> set FLASH_SIZE ...
duane>  ... [snip] ...
duane> source [find target/lpc2xxx_internals.tcl]

freddie> or mine
freddie> set CHIPNAME lpc2103
freddie> set CRYSTAL_FREQ 12000000
freddie> set JTAG_FREQ 1000000
freddie> source [find target/lpc2xxx_internals.tcl]

The *problem* use case is as follows:

I have a chip that does not have a "cfg" file that i recognize.
There is a CFG file for a chip _just_like_my_chip_

How and where do I find the information required to make it work?

Assumptions:
    1) I do not know or understand TCL -
          example: if statements look sort of weird.
          I reasonably understand rather basic "script like languages"
    
    2) I have a data sheet for part X - and the matching X.cfg file
          It is basically identical to my chip - the size of the flash 
different.
         And there are a few more/less peripherals on chip.

    3) I have a data sheet for the NEW part and need to create a .CFG file.
       I can understand a data sheet - that's what I do for work.
       I am a reasonably competent HW/SW embedded firmware engineer.

Question:

Using Method (A) or method (B)

What single file or multiple files(plural) do I modify or create?
If modifying - what parts of that file do I modify?
If not modifying - what do I read to understand? Is it simple and clear?
Are there any special rules I must follow?

how would I discover it is "set FLASH_SIZE"?
There is no mention of this in the CHIP configuration file.

====

To answer your example issue questions...

 >>  With your version the first thing the end user would notice is
 >> "what the hell is the variant?"

I would expect some reasonable #comment in the configuration file.

 >> The same goes for RAM, user would enter 40kB for lpc2148,
 >>  and that would not be right, as only 32k of those are on the
 >> local bus, the rest is for USB DMA.

I would expect to find a reasonable comment in the CFG file that
describes this scenario, for example:

   #  ram size is 32K
   # extra 8K is for usb, not usable by OpenoCD
   set RAM_SIZE  0x8000

a reasonably competent engineer with a data sheet should understand that 
comment.

-Duane.

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to