Shop OBEX P1 Docs P2 Docs Learn Events
Prop2 FPGA files!!! - Updated 2 June 2018 - Final Version 32i - Page 30 — Parallax Forums

Prop2 FPGA files!!! - Updated 2 June 2018 - Final Version 32i

12728303233160

Comments

  • mindrobots wrote: »
    It will be impossible to use 16 COGS and 512KB of hub!! :)

    (there, that should get the juices flowing!)

    That sounds like a challenge! :)
    BTW the A9 build shows 1024K of HUB (according to Ctrl-G)
  • I know but I was targeting the final chip which probably won't stretch to 1024k.

    I was just keeping it real! :)
  • Yeah, IIRC Chip said it was 1024k to allow debugging.
  • Ok, I know the A9 FPGA is 1024K, the "impossible" comment was aimed at something that would run on the final chip @512K.

    No point in people developing "awesome" that won't run on the real chip! :)

    Please limit your real applications to 512KB! :)
  • mindrobots, It was more aimed at ozpropdev, as I know that's why you aimed it at 512K :D
  • evanhevanh Posts: 15,192
    edited 2015-12-04 10:04
    I just got my A9 board - my first FPGA - yay! ... Umm, there isn't any instructions with it nor anywhere obvious on the forums.

    When I power the board up and wait a while the line of eight dimly lit leds changes to a single brightly lit led at the end nearest the breadboard. This is the default config of a single detected Cog, right?

    Loading in the latest A9 Prop2 image, with switch in PGM position, using: px.exe Prop123_A9_Prop2_v6.rbf /1 /P
    I get action of tx, rx and conf status leds all flashing away while the progress bar on px.exe progresses, then that completes and a bit later the row of eight red leds changes back to the single bright led again. :(

    Isn't this now meant to be lots (16?) of leds lit or flashing to show that more than the one Cog is available?
  • Not sure on the A9 as I don't have mine yet, but the DE2-115 and most other FPGA boards I've seen in the past have a program/run switch you need to set it to program then program the fpga then switch back to run. Hope this helps.
  • cgraceycgracey Posts: 14,133
    evanh wrote: »
    I just got my A9 board - my first FPGA - yay! ... Umm, there isn't any instructions with it nor anywhere obvious on the forums.

    When I power the board up and wait a while the line of eight dimly lit leds changes to a single brightly lit led at the end nearest the breadboard. This is the default config of a single detected Cog, right?

    Loading in the latest A9 Prop2 image, with switch in PGM position, using: px.exe Prop123_A9_Prop2_v6.rbf /1 /P
    I get action of tx, rx and conf status leds all flashing away while the progress bar on px.exe progresses, then that completes and a bit later the row of eight red leds changes back to the single bright led again. :(

    Isn't this now meant to be lots (16?) of leds lit or flashing to show that more than the one Cog is available?

    That just shows that 1 cog is running. The other lights will turn on as other cogs start up. You need to slide that switch the PGM position and then use PNut.exe to compile and download.
  • You'll only see a single red LED until you load a program and start more cogs. Load the LED blink program via PNUT and you should see 8 red LEDs lit solid and the green ones should be blinking at different rates

    It sounds like you did all the steps correctly so far.

    Welcome to the club!!
  • Ctl-G from inside PNUT with a connected FPGA will show you the signature of that FPGA image,
  • evanhevanh Posts: 15,192
    Right, cool. Any suggestions on using PNut.exe with Wine? I note that px.exe works just fine but PNut.exe can't find the Prop2.
  • evanhevanh Posts: 15,192
    edited 2015-12-04 11:16
    Hehe, I've installed Lazarus and converted the px.exe sources over. There is a comport datatype error, TDCB, to be resolved but it seems to be pretty happy with converting the Delphi sources, which is neat really.
  • IIRC Pnut requires the com port to be in the range of 1 to 9.
  • I've had no luck getting pnut to run under old or new Wine. Under new wine, px works and can find the serial port and load an image, CTL-G works from pnut but pnut will not load. BST and Propeller tool have the same problems. I've found no solution yet.

    I thought the old P2hot pnut had worked wine, but that could be my fading memory talking.

    That's been the only drawback to fpga testing - windows only club. :(
  • evanhevanh Posts: 15,192
    edited 2015-12-04 12:25
    Pnut.exe Ctrl-G fails with "No hardware found on COM1 through COM9." Wine is generating one exception, which must be getting trapped, per port number but since there is no debug symbols it's all just numbers. At each and every exception the top entry in stack trace is: call_stack_handlers calling handler at 0x40a928 code=eedfade flags=1

    Pnut.exe is loaded at 0x400000


    PS: px.exe has the same COM1-9 requirement. And well, all comports have to be hand assigned in Wine so I've got COM1 setup pointing at the A9 board as per the successful earlier px.exe programming.
  • When I dug into it a while back, it seemed like there were two ways to open a com port in windows. My assumption was px does it one way which works and pnut does it the way that doesn't. After a couple days, I gave up and went to a windows system. Life is too short!
  • jmgjmg Posts: 15,148
    edited 2015-12-04 20:51
    evanh wrote: »
    Hehe, I've installed Lazarus and converted the px.exe sources over. There is a comport datatype error, TDCB, to be resolved but it seems to be pretty happy with converting the Delphi sources, which is neat really.

    These links may help - older, but sound relevant

    http://forum.lazarus.freepascal.org/index.php?topic=4244.0
    includes a link to
    http://www.turbocontrol.com/simpleserial.htm

    the date tags are older, but I see a 2.6.0 release which is more recent.
    I also see FPC is now at 3.0.0
    http://www.freepascal.org/news.var
  • evanhevanh Posts: 15,192
    edited 2015-12-04 23:36
    Bah! That was just the first of many compile errors.

    Check this out. I get the error "PXUnit.pas(85,15) Error: Incompatible types: got "Boolean" expected "untyped"" from the following line:
    ShowHelp := True;
    
    which has prior unit declaration of:
    var
      PXForm             : TPXForm;
    
      ShowHelp           : boolean;
      FlashMode          : boolean;
    ...
    

    Not that I've ever coded pascal before but I can't understand why freepascal would think ShowHelp is untyped.

    If I comment out ShowHelp then FlashMode isn't having any issues with being assigned true and false. And if not declared then the error becomes: Identifier not found.
  • How is true defined?
  • potatohead wrote: »
    How is true defined?

    usually as not false...

    Enjoy!

    Mike

  • evanhevanh Posts: 15,192
    True and False are boolean, that's why the error is says "got boolean".

    I've given myself more work ... I found newest stable Lazarus prebuilt for Ubuntu 14.04 and started updating but ran out of volume space! ... Have also learnt that moving the start of boot partition without rerunning the grub configs or something is a bit catastrophic. T'was lucky I got a warning from the resizer when it detected it was the boot volume.
  • @evanh
    Hehe, I've installed Lazarus and converted the px.exe sources over. There is a comport datatype error, TDCB, to be resolved but it seems to be pretty happy with converting the Delphi sources, which is neat really.

    Where did you find the px.exe sources ?

  • evanhevanh Posts: 15,192
    edited 2015-12-05 09:50
    Well, I've resurfaced with a bit more knowledge of booting sequences and grub management and successfully repartitioned the boot/root volume without upset. :) Man, the live Ubuntu ISO is painfully slow! It might give me incentive to find a good specialised rescue ISO instead.

    One thing I did as an insurance, before resizing, was to make a mirror of the root volume on another drive. That had it's own surprises - the linkages to the original volumes are very sticky! It's really weird when booted from the mirror, plug the original drive in while running the mirror and you're suddenly doubling up all the volume spaces. It didn't do any harm but I was then unable to unmount, which I needed to ... I had to keep going back to using the live ISO ... :(

    My first hurdle, though, was the GPT. I managed to choose the hard road by selecting, for the mirror, the only drive with a GPT on it. This turned out to be oddly configured by not having a BIOS_Boot partition, which is a requirement when booting a GPT partitioned drive via BIOS rather than UEFI.
  • evanhevanh Posts: 15,192
    After all that, no improvement with latest Lazarus at all.

    I've renamed ShowHelp to Show_Help, that's fixed. Must have been a name clash.

    I'm down to just sorting the comms routines now. They simply need rewritten for Freepascal. I've grabbed the latest SynaSer unit stuff, it's meant to be the solution according to Mr google, but I'll pack it in for the night I think.
  • evanhevanh Posts: 15,192
    Lol, the insanity of living with little endian systems ...
    The GUIDs in this table are written assuming a little-endian byte order. For example, the GUID for an EFI System partition is written as C12A7328-F81F-11D2-BA4B-00A0C93EC93B here, which corresponds to the 16 byte sequence 28h 73h 2Ah C1h 1Fh F8h D2h 11h BAh 4Bh 00h A0h C9h 3Eh C9h 3Bh – only the first three blocks are byte-swapped.
  • Re: Live ISO.

    Two options to very seriously improve this:

    1. On boot, specify the load in RAM option. It's another half minute to minute for it to load, but then you can use it.

    2. Boot from a USB flash device. Any of them will trounce optical media, but the faster the better.

    Doing either one of these is like night and day in terms of overall usability.

  • jmgjmg Posts: 15,148
    evanh wrote: »
    I've renamed ShowHelp to Show_Help, that's fixed. Must have been a name clash.

    Yes, if you right click Show declaration, it finds ShowHelp as an aded procedure, in a Lazarus included unit.

    I got this far in Windows Delphi -> Lazarus using the tools to convert.
    Tools.Convert Delphi Project to Lazarus Project [1.2.0 FPC 2.6.2 Windows]
     Options : 
      Cross Platform [Off]
      Support Delphi [On]
      Function Replacements [Disabled]  << this seems worse if on (default).
    Search-replace: ShowHelp -> ShowHelpL  
    (Reason: There is a ShowHelp Procedure defined in an added Lazarus unit )
    
    * Converting file D:\..\Propeller_123_FPGA_A9\PX - Delphi Source\PX.dpr *
    Added defines -dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL in custom options
    Found all unit files
    * Fixing used units for file D:\..\Propeller_123_FPGA_A9\PX - Delphi Source\PX.dpr *
    
    *** Converting unit files belonging to project/package ***
    * Converting file D:\..\Propeller_123_FPGA_A9\PX - Delphi Source\PXUnit.pas *
    * Converting file D:\..\Propeller_123_FPGA_A9\PX - Delphi Source\PXHelp.pas *
    
    *** Fixing used units and Repairing form files ***
    * Repairing form file D:\..\Propeller_123_FPGA_A9\PX - Delphi Source\PXUnit.lfm *
    Removed property "TextHeight".
    Removed property "OldCreateOrder".
    * Fixing used units for file D:\..\Propeller_123_FPGA_A9\PX - Delphi Source\PXUnit.pas *
    * Repairing form file D:\..\Propeller_123_FPGA_A9\PX - Delphi Source\PXHelp.lfm *
    Removed property "TextHeight".
    Removed property "OldCreateOrder".
    Changed Top coord of TLabel from "52" to "50" inside TPanel.
    Changed Left coord of TLabel from "8" to "6" inside TPanel.
    Changed Top coord of TLabel from "32" to "30" inside TPanel.
    Changed Left coord of TLabel from "8" to "6" inside TPanel.
    Changed Top coord of TLabel from "10" to "8" inside TPanel.
    Changed Left coord of TLabel from "8" to "6" inside TPanel.
    * Fixing used units for file D:\..\Propeller_123_FPGA_A9\PX - Delphi Source\PXHelp.pas *
    Conversion took: 00:00:04
    Conversion Ready.
    
    Build:
    PXUnit.pas(109,37) Hint: Local variable "AlteraFileName" does not seem to be initialized
    PXUnit.pas(111,37) Hint: Local variable "MemoryFileName" does not seem to be initialized
    PXUnit.pas(296,42) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
    PXUnit.pas(307,56) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
    PXUnit.pas(426,66) Hint: Local variable "BytesWritten" does not seem to be initialized
    PXUnit.pas(10,12) Hint: Unit "messages" not used in PXUnit
    Project "PX" successfully built
    

  • jmgjmg Posts: 15,148
    evanh wrote: »

    This patch fixes the (self imposed) COM1..9 limit in Windows :
          if (s[1] = '/') then begin
            if s[2] = 'P' then FlashMode := True
            else if (s[2] in ['1'..'9']) then CommPort := 'COM' + Copy(s,2,3) //COM1..999, tested on COM6 & COM57
            else ErrorAbort('Invalid /? parameter.');
          end
    
    
Sign In or Register to comment.