Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    emard
    @emard
    Wherever you suggest is the proper place. From bitstream, this pin needs a kind of "fuze" logic in order not to be triggered at early start of bitstream when the LUTs set up and can do some glitch.. I use some counter that starts from 0 and must be clocked few times. shutdown pin is connected to MSB bit of this counter.
    Lawrie Griffiths
    @lawrie
    @emard That is impressive, doing all the i2c access from C. And it good that lcc and its library had all the features you needed. Some of them only added in the last day or two.
    Dolu1990
    @Dolu1990
    i will add a ulx3s opensbi plateform specific port
    and already try the reboot ^^
    emard
    @emard
    @lawrie great stuff this i2c really, simple and works!
    @Dolu1990 yes reboot would be first step to make. For board shutdown it needs battery, configured RTC with alarm that triggers in the future and power from US2 or from US1 with green power LED set to OFF. I can assist with this
    Dolu1990
    @Dolu1990
    Are you aware of a blackbox to instanciate in the FPGA to be able to reload the bitstream when asked ?
    Or i should use the PROGRAMN FPGA input pin via USER_PROGRAMN from the schematic
    emard
    @emard
    I actually didnt know of blackbox but pulling down programn will reload bitstream from flash. If bitstream is build as multiboot (using command ecpmulti) then programn will jump to next bitstream in FLASH
    For your this blackbox will be better if it works as it will reload current bitstream having saxonsoc in FPGA SRAM (regardless what in FLASH is)
    emard
    @emard
    @pnru_gitlab I have used your hwclock to calculate date but it does it with few days off :) https://github.com/emard/hwclock4saxonsoc can you check whats up wrong
    Paul Ruiz
    @pnru_gitlab
    Again very little time today. I indeed had an issue with being 1 day off when I did that I2C code - maybe my code in date is also off and I now have matched errors on the Cortex :^). Here is a reviewed routine. @lawrie - in this form it is not suitable for c.lib, because it does not take an argument but works on a global var.
    emard
    @emard
    No problem I will find correct formula
    its called sakamoto-gregorian something
    Paul Ruiz
    @pnru_gitlab
    I think I took the algorithm in 4.2BSD as a base (several years ago). If I look at the code at the end of function gtime(), I think my reviewed routine is essentially the same (i.e. should be good).
    emard
    @emard
    Maybe I during editing typed something wrong. I will rewrite :)
    emard
    @emard
    The rewritten version is here now it matches with date -u --date="@<unix_seconds>" https://github.com/emard/hwclock4saxonsoc/blob/master/hwclock.c#L163 I dont know why it works :)
    hwclock -s will set correct system date from RTC
    Dolu1990
    @Dolu1990
    So i checked, the linux risc-v port used do not implement restart, only shutdown XD
    So, i got the shutdown command in linux to successfully restart the FPGA
    emard
    @emard
    Real shutdown is possible with shutdown pin set to 1. after that you can wat few ms and proceed with restart. If RTC has not been setup it will restart otherwise it will shutdown
    It's because althugh commanded to shutdown, RTC and green LED will keep waking up the board and shutdown pin will be ignored
    Dolu1990
    @Dolu1990
    Ahhh ok
    I was asking myself why shutdown wasn't ok ^^
    Lawrie Griffiths
    @lawrie
    @pnru_gitlab Do you know why lcc/bin/libs contains both softfloat and libsoftfloat and why it contains eeprintf? We do not include softfloat and eeprintf in c.lib.
    emard
    @emard
    @Dolu1990 https://github.com/emard/ulx3s/blob/master/doc/MANUAL.md#low-power-mode is somehow tried to explain all prerequisites for real shutdown to happen. When conditions are met for real shutdown LED D11 on bottom side of board will be dimly lit. Only then shutdown pin=1 will be accepterd as real power off, otherwise ignored
    emard
    @emard
    I think after all disks are synced and unmonuted, set shutdown=1 and wait about 100ms - if it can shutdown it will go OFF otherwise it keep powered - then you can proceed to reload FPGA bitstream in order to reboot instead of shutdown
    Dolu1990
    @Dolu1990

    I pushed on SaxonSoc and opensbi the changes. linux shutdown will cleanly trigger the shutdown pin in opensbi after the OS is off.
    It require :
    bitstream update, opensbi update.

    Also, the opensbi plaform used is now a ulx3s dedicated one, so binary path in the opensbi folder changed

    Dolu1990
    @Dolu1990
    basicaly, writing 1 at 0x10bff000 do a restart, writting 2 do a shutdown
    emard
    @emard
    thnx!!!! I will test it tomorrow and with some additional i2c rtc alarm set I can also check wake-on-rtc function now
    Lawrie Griffiths
    @lawrie
    @emard @Dolu1990 I have updated opensbi and the bitstream on my 12F and it is running. Not sure how to test the change.
    Dolu1990
    @Dolu1990
    personnaly, i mesured on the board the shutdown reset
    else, i also tried with openocd via the telnet
    but in short, unless you configure the RTC, you can't realy observe the feature
    Lawrie Griffiths
    @lawrie
    @emard I have updated the 12F 1core bitstream and opensbi (fw_jump.bin@0x340000) in Smp. You will need to flash the new fw_jump.bin@0x340000.
    emard
    @emard
    Yes we have all the parts for RTC party :) I can test it later on actual board with battery!!
    Dolu1990
    @Dolu1990
    so, just for sanity, the linux reboot command is doing nothing
    only shutdown can be used
    Paul Ruiz
    @pnru_gitlab

    @pnru_gitlab Do you know why lcc/bin/libs contains both softfloat and libsoftfloat and why it contains eeprintf? We do not include softfloat and eeprintf in c.lib.

    Not sure. I think all the "extras" are test files once used during development and not needed in c.lib (because the final, debugged versions are included already).
    I've asked Michael about the origins of his lib and it comes from a student / university project that looked at an optimized MIPS processor. All in all, as you already concluded there does not seem to be much point in keeping in line with "upstream".

    Lawrie Griffiths
    @lawrie
    @pnru_gitlab Also do you know what cpp is? Both cpp and ucpp are built. ucpp is the C-preprocessor, but I don't know what cpp is any whether it is needed.
    Paul Ruiz
    @pnru_gitlab
    It would seem that cpp is the C pre-processor as shipped with the original lcc. The new ucpp appears to be a lightweight version of cpp that Michael included for his RiscV work. The original cpp is probably not used anymore.
    Lawrie Griffiths
    @lawrie
    Lawrie Griffiths
    @lawrie
    @danrr_au_twitter I am trying to build your risc-v game, but I get this when build the bitstream in the submodule:
    ecppack --input ulx3s.config --svf ulx3s.svf
    Failed to process input config: unrecognised config entry .sysconfig
    Do you or anyone else, know what is causing this?
    David Shah
    @daveshah1
    It is a nextpnr update
    to support Diamond-style sysconfig lines in the LPF
    update trellis and it will be supported by trellis too
    Lawrie Griffiths
    @lawrie
    Thanks.
    Lawrie Griffiths
    @lawrie
    The game is running now, so I will have to try the music.