Shop OBEX P1 Docs P2 Docs Learn Events
C: XMMC And CFG Files — Parallax Forums

C: XMMC And CFG Files

idbruceidbruce Posts: 6,197
edited 2015-04-01 05:25 in Propeller 1
A while back, I started a thread about the use of the Propeller Memory Card, in combination with SimpleIDE (http://forums.parallax.com/showthread.php/160215-Propeller-Memory-Card-SimpleIDE-GCC), and this thread is related, but a bit more specific. Additionally, within in that thread, David Betz was kind enough to post a CFG file for the Propeller Memory Card.

I have reached a point in my project, where the flash memory functionality of the Propeller Memory Card has become an absolute necessity. As the title clearly states, I am shooting for the XMMC memory model.

Okay so now back to David's CFG file..... It is my understanding that I have to use the Propeller Loader of GCC to load this CFG file. Okay, I suppose I can live with that...... but what about the rest of my project...... Do I have to leave SimpleIDE behind and now use the Propeller Loader for the rest of my project?
«1

Comments

  • David BetzDavid Betz Posts: 14,516
    edited 2015-03-28 10:22
    idbruce wrote: »
    A while back, I started a thread about the use of the Propeller Memory Card, in combination with SimpleIDE (http://forums.parallax.com/showthread.php/160215-Propeller-Memory-Card-SimpleIDE-GCC), and this thread is related, but a bit more specific. Additionally, within in that thread, David Betz was kind enough to post a CFG file for the Propeller Memory Card.

    I have reached a point in my project, where the flash memory functionality of the Propeller Memory Card has become an absolute necessity. As the title clearly states, I am shooting for the XMMC memory model.

    Okay so now back to David's CFG file..... It is my understanding that I have to use the Propeller Loader of GCC to load this CFG file. Okay, I suppose I can live with that...... but what about the rest of my project...... Do I have to leave SimpleIDE behind and now use the Propeller Loader for the rest of my project?
    As far as I know, SimpleIDE still uses propeller-load to load programs. You would just need to add an entry for the new .cfg file into a file that is called, I think, "boards.txt" or something like that. It lists the boards that appear in the board configuration dialog box in SimpleIDE. Once your board appears, you can just select it. No need to abandon SimpleIDE or even to use propeller-load directly.
  • idbruceidbruce Posts: 6,197
    edited 2015-03-28 13:01
    David
    As far as I know, SimpleIDE still uses propeller-load to load programs. You would just need to add an entry for the new .cfg file into a file that is called, I think, "boards.txt" or something like that. It lists the boards that appear in the board configuration dialog box in SimpleIDE. Once your board appears, you can just select it. No need to abandon SimpleIDE or even to use propeller-load directly.

    Now that sounds cool enough. Thanks David, I will look into that.
  • idbruceidbruce Posts: 6,197
    edited 2015-03-28 15:40
    I have been doing some investigation and here is what I have found, as well as assumptions that I have made, concerning the Propeller Memory Card.

    If you use SimpleIDE, you will have a file named winbond.cfg on your computer. I am assuming that this configuration file is compatile with the Winbond W25Q32FV and that it is applicable to the Quad Peripheral Interface, and if not, then the Serial Peripheral Interface.

    The contents of this file is as follows:
    # winbond
    # IDE:SDLOAD
    # IDE:SDXMMC
        clkfreq: 80000000
        clkmode: XTAL1+PLL16X
        baudrate: 115200
        rxpin: 31
        txpin: 30
        tvpin: 12   # only used if TV_DEBUG is defined
        cache-driver: winbond_sqi_flash_cache.dat
        cache-size: 8K
        cache-param1: 0x06000a01 # 0xssxxccpp - ss=sio0 xx=unused cc=sck pp=simple-cs
        cache-param2: 0x0b000000 # 0xaabbccdd - aa=ce bb=unused cc=unused dd=unused
        sd-driver: sd_driver.dat
        sdspi-do: 10
        sdspi-clk: 11
        sdspi-di: 9
        sdspi-clr: 25
        sdspi-inc: 8
        sdspi-addr: 5
    

    Considering that I am only interested in writing a configuration for the flash memory at this point, I believe I can alter the file to look like this:
    # mycontroller
    # IDE:FLASHXMMC
        clkfreq: 80000000
        clkmode: XTAL1+PLL16X
        baudrate: 115200
        rxpin: 31
        txpin: 30
        cache-driver: winbond_sqi_flash_cache.dat
        cache-size: 8K
        cache-param1: 0x06000a01 # 0xssxxccpp - ss=sio0 xx=unused cc=sck pp=simple-cs
        cache-param2: 0x0b000000 # 0xaabbccdd - aa=ce bb=unused cc=unused dd=unused
    

    I further believe that this configuration needs further alteration, in fact I am certain, but more specifically, the cache-param1 and cache-param2 values need to be altered. Just by looking at the associated comments for these values, I am making the following assumptions:

    cache-param1 ss = IO0 on the Winbond chip
    cache-param1 cc = CLK on the Winbond chip
    cache-param1 pp = /CS on the Winbond chip

    cache-param2 ce = (Your guess is as good as mine) on the Winbond chip

    Does anyone have any idea what the heck "ce" is supposed to be????????

    EDIT: At first I was thinking this was a pin value, but then I got to thinking what if I am wrong, so I began searching the data sheet and I found an instruction named chip erase and now I am assuming that is what "ce" is supposed to be and that value can remain unchanged, or so I think.
  • idbruceidbruce Posts: 6,197
    edited 2015-03-28 17:51
    The load failed.

    Now either that is the wrong driver or the values that I entered for the cfg file are incorrect.

    Here are my pin values for the Winbond W25Q32FV flash memory chip: IO0 = 8, /CS = 13, CLK = 15.

    And here is how they are entered, but I think it is wrong:
        cache-param1: 0x08001513 # 0xssxxccpp - ss=sio0 xx=unused cc=sck pp=simple-cs
        cache-param2: 0x0b000000 # 0xaabbccdd - aa=ce bb=unused cc=unused dd=unused
    

    attachment.php?attachmentid=113695&d=1427590112

    Is this the wrong driver? If so, David, could you please upload the required DAT files to go with that CFG file?
    341 x 265 - 26K
  • idbruceidbruce Posts: 6,197
    edited 2015-03-28 20:48
    David,
    Your work is not forgotten. The Propeller Memory Card will have SimpleIDE support, but it was better to release it now without it than to delay the memory card while the SimpleIDE team was working to release version 0.9.40. Also, I implemented the changes mentioned in this post, so it might have broken the driver you posted.

    Before getting it officially listed as a board type in SimpleIDE, I can add your C code to the product downloads section, or I can add a link to a forum post or object exchange entry if you want to be able to update it quickly. I can send you one of the final prototypes, essentially indistinguishable from the production units, if you would like to verify it with the new pinout.

    — David Carrier
    Parallax Inc.

    The lack of support on this product is really starting to upset me.
  • idbruceidbruce Posts: 6,197
    edited 2015-03-29 08:27
    Here is my latest atempt to get my flash working, but it is still failing.
    # mycontroller
    clkfreq: 80000000
    clkmode: XTAL1+PLL16X
    baudrate: 115200
    rxpin: 31
    txpin: 30
    cache-driver: winbond_sqi_flash_cache.dat
    cache-size: 8K
    cache-param1: (8 << 24) | (9 << 16) | (15 << 8) | 0x01 # 0xssxxccpp - ss=sio0 xx=unused cc=sck pp=simple-cs
    cache-param2: (13 << 24) # 0xaabbccdd - aa=ce bb=unused cc=unused dd=unused
    
    # IO0 = 8
    # IO1 = 9
    # IO2 = 10
    # IO3 = 11
    # CS = 13
    # CLK = 15
    

    attachment.php?attachmentid=113698&d=1427642765
    594 x 262 - 30K
  • David BetzDavid Betz Posts: 14,516
    edited 2015-03-29 13:29
    idbruce wrote: »
    The lack of support on this product is really starting to upset me.
    I'm sorry but I'm probably the only one who knows how the XMM drivers work and I don't have a lot of time to answer questions. Can you remind me of how you have your memory card configured? Is it plugged into a QuickStart board? I guess I need to be able to duplicate your setup.
  • David BetzDavid Betz Posts: 14,516
    edited 2015-03-29 14:21
    I've just plugged a PMC into an ActivityBoard with the same pin assignments as you mention in your posts. Are you using the version of PropGCC that comes with SimpleIDE?
  • idbruceidbruce Posts: 6,197
    edited 2015-03-29 19:24
    David
    I'm sorry but I'm probably the only one who knows how the XMM drivers work and I don't have a lot of time to answer questions.

    Well that explains a lot, however any info I found pertaining to cfg and dat files, you were there in the midst of the discussion. By the way, that was not intended to be a poke at you. I am more or less just disgusted that a driver does not already exist for this hardware.
    Can you remind me of how you have your memory card configured? Is it plugged into a QuickStart board? I guess I need to be able to duplicate your setup.

    This setup is on a Propeller Proto Board with the following pin assignments:

    'Propeller Memory Card Pin Assignments
    DI = 8 'IO0 / DI / MOSI / CD Pin
    DO = 9 'IO1 / DO / MISO Pin
    WP = 10 'IO2 / WP Pin
    HOLD = 11 'IO3 / HOLD Pin
    SD_CS = 12 'CS Pin For MicroSD Card Memory
    FLASH_CS = 13 'CS Pin For Flash Memory
    SRAM_CS = 14 'CS Pin For SRAM Memory
    CLK = 15 'CLK Pin
    Are you using the version of PropGCC that comes with SimpleIDE?

    Yes I am

    ***************************************************

    How are the dat files made and what is in them? I cannot find any documentation on this subject.

    If you are the most knowledgable person about XMM drivers, then perhaps this info may help you in the future.... http://openocd.org/doc/doxygen/html/spi_8c_source.html
  • David BetzDavid Betz Posts: 14,516
    edited 2015-03-29 19:54
    I'm afraid that the XMM support is in a bit of a mess currently. There were drivers that worked with release_1_0 of PropGCC which is the version that comes with SimpleIDE but there doesn't seem to be a Propeller Memory Card driver there. There are also some completely different drivers that work with the master branch of PropGCC. Those are the ones I've been looking at but I can't seem to get my PMC to work with the driver I thought was working. I'm going to have to get out my logic analyzer and try to figure out what's going wrong. In any case, I have your setup duplicated except on an ActivityBoard instead of a Proto Board but that shouldn't really make any difference. If I can get code running on mine it should work on yours as well.

    Also, there were drivers released with the Propeller Memory Card but they were Spin drivers.
  • idbruceidbruce Posts: 6,197
    edited 2015-03-29 21:08
    David
    In any case, I have your setup duplicated except on an ActivityBoard instead of a Proto Board but that shouldn't really make any difference.

    Thanks alot David, because I certainly need help with this issue.
  • David BetzDavid Betz Posts: 14,516
    edited 2015-03-29 21:11
    FYI, I just tried the c3 xmem driver on the master branch and it doesn't seem to work either. Something seems to have changed on the master branch that has caused a regression. I'll have to track it down but I'm not going to be able to do it tonight. Sorry!
  • David BetzDavid Betz Posts: 14,516
    edited 2015-03-29 21:36
    Do you have a way to use the master branch of propgcc instead of the release_1_0 branch that comes with SimpleIDE? If so, please try this .cfg file. It works for me with the PMC plugged into the an ActivityBoard connected as indicated below. I'm not sure why the flash-only driver doesn't work. I'll have to look into that further.
    # pmc-ab.cfg
    # for the ActivityBoard with the Propeller Memory Card plugged in as follows:
    #
    # io0 on pin 8
    # io1 on pin 9
    # io2 on pin 10
    # io3 on pin 11
    # sd /cs on pin 12
    # flash /cs on pin 13
    # sram /cs on pin 14
    # clk on pin 15
    
    clkfreq: 80000000
    clkmode: XTAL1+PLL16X
    baudrate: 115200
    rxpin: 31
    txpin: 30
    
    # cache geometry - 128 * 64 = 8192 byte cache
    index-width: 7      # 2^7 = 128 cache lines
    offset-width: 6     # 2^6 = 64 byte cache lines
    cache-geometry: ({index-width} << 8) | {offset-width}
    
    # xmem_param1 - 0xssccffrr where ss=sio0, cc=clk, ff=flash cs, rr=sram cs
    # xmem_param2 - $ssxxxxff where ss=sd cs, ff=1 to initialize sd card
    xmem-driver: winbond_sqi_flash_sram_xmem.dat
    xmem-param1: (8 << 24) | (15 << 16) | (13 << 8) | 14
    xmem-param2: (12 << 24) | 1
    
  • idbruceidbruce Posts: 6,197
    edited 2015-03-29 23:18
    David
    Do you have a way to use the master branch of propgcc instead of the release_1_0 branch that comes with SimpleIDE? If so, please try this .cfg file. It works for me with the PMC plugged into the an ActivityBoard connected as indicated below. I'm not sure why the flash-only driver doesn't work. I'll have to look into that further.

    I must admit that I am a tad confused. Is this what I want? Or is this same one that comes with SimpleIDE?

    attachment.php?attachmentid=113700&d=1427695380

    Or are you talking about the information that you gave me earlier? Which was:
    The "default branch" is what you get by default if you clone this repository:

    https://code.google.com/p/propgcc/source/checkout

    However, you currently have to build it yourself. :-(

    And if so, just exactly where do I type this command?

    attachment.php?attachmentid=113701&d=1427696217
    688 x 306 - 48K
    698 x 303 - 47K
  • Heater.Heater. Posts: 21,230
    edited 2015-03-30 04:21
    Bruce,

    If you want to checkout propgcc from google code you need the Mercurial version control system installed. I have no idea about that for windows but a proper machine you would then open up a command line window and type:
    hg clone https://code.google.com/p/propgcc/
    
    Then change to the propgcc directory that creates and read the instruction found in there telling how to build it.

    Of course propgcc is now migrating from Mercurial to git and from google to github. You might want to read the short thread about that on the front page here.

    I'm sure David is a better person to talk about that than me.
  • idbruceidbruce Posts: 6,197
    edited 2015-03-30 04:31
    Heater
    Bruce,

    If you want to checkout propgcc from google code you need the Mercurial version control system installed. I have no idea about that for windows but a proper machine you would then open up a command line window and type:

    Code:
    hg clone https://code.google.com/p/propgcc/Then change to the propgcc directory that creates and read the instruction found in there telling how to build it.

    Yes and that is another option. They do have something for Windows, but then I am unsure whether I have to install Python. It almost sounds endless.
  • David BetzDavid Betz Posts: 14,516
    edited 2015-03-30 05:24
    SwimDude0614 has been working on providing regular builds of all of the trees. Check with him to see if he has a build of the master branch that you can use.
  • idbruceidbruce Posts: 6,197
    edited 2015-03-30 06:10
    David
    SwimDude0614 has been working on providing regular builds of all of the trees. Check with him to see if he has a build of the master branch that you can use.

    It is beginning to seem like I am chasing after lost money and I have already wasted too much time on a product that should already be fully supported, since it is still up for sale at Parallax.com. In my opinion, this issue should be resolved quickly, but then again, I realize my opinion does not matter much.

    Anyhow, what are the odds of you supplying me with the DAT file that you are using and it possibly working???
  • David BetzDavid Betz Posts: 14,516
    edited 2015-03-30 06:15
    idbruce wrote: »
    David



    It is beginning to seem like I am chasing after lost money and I have already wasted too much time on a product that should already be fully supported, since it is still up for sale at Parallax.com. In my opinion, this issue should be resolved quickly, but then again, I realize my opinion does not matter much.

    Anyhow, what are the odds of you you supplying me with the DAT file that you are using and it possibly working???
    The DAT file I'm using is a standard part of the master build and it will only work with that build. It won't work with the version of PropGCC that comes with SimpleIDE. Once you get a build of the master branch, you'll have everything you need besides the .cfg file that I posted here in message #14.
  • idbruceidbruce Posts: 6,197
    edited 2015-03-30 06:20
    David
    Once you get a build of the master branch, you'll have everything you need besides the .cfg file that I posted here in message #14.

    Okay, at that point, I would then assume that the development of my code would then be restricted to the build of the master branch. Is my assumption correct?
  • David BetzDavid Betz Posts: 14,516
    edited 2015-03-30 06:26
    idbruce wrote: »
    David



    Okay, at that point, I would then assume that the development of my code would then be restricted to the build of the master branch. Is my assumption correct?
    Yes, I'm afraid that is true. We changed the interface to the external memory drivers between release_1_0 and master so the old drivers will no longer work on the master branch. Conversely, the new drivers won't work with release_1_0. It is possible that the old PMC drivers could be used on release_1_0 but I don't currently have time to uncover them and test them. I never expected the move to the master branch to take so long. It has been ready for many months if not a year but lack of resources for testing have prevented it from moving into production as release_2_0.
  • idbruceidbruce Posts: 6,197
    edited 2015-03-30 06:28
    David
    The DAT file I'm using is a standard part of the master build and it will only work with that build.

    I have no idea about the intricacies of propgcc, but this also seems like another issue that should be resolved quickly. The use of drivers should be build independent, because there are bound to be numerous drivers down the road and requiring a new master build for each driver sounds like a major pain.
  • David BetzDavid Betz Posts: 14,516
    edited 2015-03-30 06:30
    idbruce wrote: »
    David



    I have no idea about the intricacies of propgcc, but this also seems like another issue that should be resolved quickly. The use of drivers should be build independent, because there are bound to be numerous drivers down the road and requiring a new master build for each driver sounds like a major pain.
    The driver interface had to change because Parallax wanted the ability to run XMMC code on more than one COG at a time and the old driver interface did not support that.
  • DavidZemonDavidZemon Posts: 2,973
    edited 2015-03-30 06:48
    Fair warning... this has not been tested. It is the first and only successful Windows build to come out of my TeamCity server, based on the master/default branch of propgcc. As I continue to stabilize TeamCity, I will get a GCC5 version too (and test it! :P)

    http://david.zemon.name/downloads/propgcc-win-32.zip
  • David BetzDavid Betz Posts: 14,516
    edited 2015-03-30 06:54
    Fair warning... this has not been tested. It is the first and only successful Windows build to come out of my TeamCity server, based on the master/default branch of propeller-gcc. As I continue to stabilize TeamCity, I will get a GCC5 version too (and test it! :P)

    http://david.zemon.name/downloads/propgcc-win-32.zip
    Ummm, okay. This is yet another variable. The propeller-gcc branch uses the new version of binutils and also a different version of the libraries. The XMM support is unchanged from the propgcc master though so it should be okay.
  • idbruceidbruce Posts: 6,197
    edited 2015-03-30 06:57
    The driver interface had to change because Parallax wanted the ability to run XMMC code on more than one COG at a time and the old driver interface did not support that.

    Sounds to me like a person would have to become fully entrenched in propgcc just to experiment with various types of memory and new memory chips, and memory support is limited to the chips that already have drivers. It would be nice if a person could just create the DAT and CFG files and test their new hardware.
  • DavidZemonDavidZemon Posts: 2,973
    edited 2015-03-30 07:00
    David Betz wrote: »
    Ummm, okay. This is yet another variable. The propeller-gcc branch uses the new version of binutils and also a different version of the libraries. The XMM support is unchanged from the propgcc master though so it should be okay.

    Oh, sorry. I had my repo names confused. It's based off the old repo, which is now
    https://github.com/parallaxinc/propgcc
    Specifically, commit 3d1c062db245585d87875d4118e71b9a259374f4
  • David BetzDavid Betz Posts: 14,516
    edited 2015-03-30 07:00
    idbruce wrote: »
    Sounds to me like a person would have to become fully entrenched in propgcc just to experiment with various types of memory and new memory chips, and memory support is limited to the chips that already have drivers. It would be nice if a person could just create the DAT and CFG files and test their new hardware.
    That is possible as long as you start with the master branch build. There is even a skeleton XMEM driver to use as a template.
  • idbruceidbruce Posts: 6,197
    edited 2015-03-30 07:08
    That is possible as long as you start with the master branch build. There is even a skeleton XMEM driver to use as a template.

    Okay... Let me state it differently then....

    Let's say that a person wanting to create a new hardware driver has to create it within a master branch build. At which point, they should be able to store both the CFG and DAT file within the C:\Program Files\SimpleIDE\propeller-gcc\propeller-load folder and test it using SimpleIDE.
  • David BetzDavid Betz Posts: 14,516
    edited 2015-03-30 07:10
    idbruce wrote: »
    Okay... Let me state it differently then....

    Let's say that a person wanting to create a new hardware driver has to create it within a master branch build. At which point, they should be able to store both the CFG and DAT file within the C:\Program Files\SimpleIDE\propeller-gcc\propeller-load folder and test it using SimpleIDE.
    Yes that's true although they will also have to add their .cfg file to boards.txt.
Sign In or Register to comment.