Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    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.
    Lawrie Griffiths
    @lawrie
    It is very very very slow to flash with fujprog.
    Lawrie Griffiths
    @lawrie
    The music sounds very good using sdpdif, but a bit jazzy for my taste.
    Lawrie Griffiths
    @lawrie
    I couldn't find a joystick that it works with.
    emard
    @emard
    @lawrie for shutdown do I need new u-boot version (currently its 5 days ago, music edition) or just fw_jump?
    Dolu1990
    @Dolu1990
    uboot is fine
    didn't changed it since a eternity ^^
    just fw_jump and the bitstream
    emard
    @emard
    It won't boot at 12F anymore
    Lawrie Griffiths
    @lawrie
    What happens?
    emard
    @emard
    OK it boots now, maybe I forgot dtb.12f, updated it!
    Lawrie Griffiths
    @lawrie
    The dtb hadn't changed.