raj
raj

Reputation: 1

Is there any support for GPIO emulation on a RISC-V MCU e.g. SiFive HiFive1 Rev B

FYI: I have asked the same question on https://github.com/renode/renode/issues/723 but I figured it might not be a good place to start with. This logs mentioned below are a stripped down version of the original one, but no crucial information is lost, same goes for the references. I do not have enough reputation to post more than 8 links so I have replaced forward slashes in urls with a space (within logs only). Sorry for inconvenience if any.

I am trying to simulate a blinky application on the mentioned dev. board using PlatformIO installed on VSCodium.

Setup: I am using the example project for SiFive platform located in C:\Users\<user_name>\.platformio\platforms\sifive\examples\native-blink_asm. Here are the contents of platformio.ini file:

[env:sifive-hifive1-revb]
platform = sifive
framework = freedom-e-sdk
board = hifive1-revb
monitor_speed = 115200

upload_flags =
    -e include @${renode.renode_root_dir}"/scripts/single-node/sifive_fe310.resc"
    -e logLevel -1
    -e sysbus LoadELF @$PROJECT_BUILD_DIR\$PIOENV\$PROGNAME".elf"
    -e start
upload_command = ${renode.renode_root_dir}"/bin/Renode.exe" $UPLOAD_FLAGS

[renode]
renode_root_dir = C:/Users/Admin/Downloads/renode_1.15.3

Code: I have moved the content out of while loop, and added a print statement in src\superBlink.c like so: Main code

Output: The code compiles successfully, gets loaded successfully in Renode, but I receive a warning: [WARNING] gpioInputs: Trying to write a pin that isn't configured for writing. Skipping. Received warning

Complete log:

 *  Executing task in folder native-blink_asm: C:\Users\Admin\.platformio\penv\Scripts\platformio.exe run --target upload --target monitor 

Processing sifive-hifive1-revb (platform: sifive; framework: freedom-e-sdk; board: hifive1-revb)
--------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: [URL](docs.platformio.org page boards sifive hifive1-revb.html)
PLATFORM: SiFive (5.2.0) > HiFive1 Rev B
HARDWARE: FE310 320MHz, 16KB RAM, 16MB Flash
DEBUG: Current (jlink) On-board (jlink, renode)
PACKAGES:
 - framework-freedom-e-sdk @ 2.20050003.200818 (2005.0.3)
 - tool-jlink @ 1.78811.0 (7.88.11)
 - tool-openocd-riscv @ 2.1000.20190927 (10.0)
 - toolchain-riscv @ 1.80300.190927 (8.3.0)
Installing Freedom E SDK's Python dependencies
Requirement already satisfied: pyparsing==2.4.5 in c:\users\admin\.platformio\penv\lib\site-packages (2.4.5)
Requirement already satisfied: MarkupSafe==2.0.1 in c:\users\admin\.platformio\penv\lib\site-packages (2.0.1)
Requirement already satisfied: Jinja2==2.10.1 in c:\users\admin\.platformio\penv\lib\site-packages (2.10.1)
LDF: Library Dependency Finder -> [URL Shortner](bit.ly configure-pio-ldf)
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
...
Archiving .pio\build\sifive-hifive1-revb\libmetal-gloss.a
Linking .pio\build\sifive-hifive1-revb\firmware.elf
Checking size .pio\build\sifive-hifive1-revb\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [====      ]  36.9% (used 6048 bytes from 16384 bytes)
Flash: [          ]   0.1% (used 19126 bytes from 16777216 bytes)
Building .pio\build\sifive-hifive1-revb\firmware.hex
Configuring upload protocol...
AVAILABLE: jlink
CURRENT: upload_protocol = jlink
Uploading .pio\build\sifive-hifive1-revb\firmware.hex
17:22:22.1595 [INFO] Loaded monitor commands from: C:\Users\Admin\Downloads\renode_1.15.3\scripts/monitor.py
17:22:22.7074 [INFO] Including script: C:\Users\Admin\Downloads\renode_1.15.3\scripts\single-node\sifive_fe310.resc
17:22:22.7446 [INFO] System bus created.
17:22:23.8319 [INFO] sysbus: Loaded SVD: C:\Users\Admin\AppData\Local\Temp\renode-18648\2b966218-ffbe-4e31-97c2-202484042c53.tmp. Name: FE310. Description: E31 CPU Coreplex, high-performance, 32-bit RV32IMAC core
      .
17:22:23.9107 [INFO] sysbus: Loading segment of 20520 bytes length at 0x20400000.
17:22:23.9429 [INFO] sysbus: Loading segment of 324 bytes length at 0x20405028.
17:22:23.9439 [INFO] sysbus: Loading segment of 7944 bytes length at 0x80000148.
17:22:23.9690 [INFO] cpu: Setting PC value to 0x20401BC4.
17:22:24.4090 [DEBUG] sysbus: Loading ELF D:\FOXGROUP\RAJAT_PATIL\Softwares\utilities\development\PlatformIO\native-blink_asm\.pio\build\sifive-hifive1-revb\firmware.elf.
17:22:24.4090 [INFO] sysbus: Loading segment of 3680 bytes length at 0x20010000.
17:22:24.4090 [NOISY] qspi0Xip: Invalidating memory fragment at 0x10000 of size 3680 bytes.
17:22:24.4090 [DEBUG] sysbus: Segment loaded.
17:22:24.4090 [INFO] sysbus: Loading segment of 2800 bytes length at 0x20013FF0.
17:22:24.4090 [NOISY] qspi0Xip: Invalidating memory fragment at 0x13FF0 of size 2800 bytes.
17:22:24.4090 [DEBUG] sysbus: Segment loaded.
17:22:24.4090 [INFO] sysbus: Loading segment of 3248 bytes length at 0x80000AF0.
17:22:24.4090 [NOISY] dtim: Invalidating memory fragment at 0xAF0 of size 3248 bytes.
17:22:24.4090 [DEBUG] sysbus: Segment loaded.
17:22:24.4090 [INFO] sysbus: Loading segment of 0 bytes length at 0x0.
17:22:24.4090 [DEBUG] sysbus: Segment loaded.
17:22:24.4090 [INFO] sysbus: Loading segment of 12654 bytes length at 0x20010E80.
17:22:24.4090 [NOISY] qspi0Xip: Invalidating memory fragment at 0x10E80 of size 12654 bytes.
17:22:24.4090 [DEBUG] sysbus: Segment loaded.
17:22:24.4279 [INFO] cpu: Setting PC value to 0x20010000.
17:22:24.4339 [NOISY] SiFive-FE310: Starting sysbus.cpu.
17:22:24.4359 [NOISY] cpu: Resumed.
17:22:24.4369 [INFO] SiFive-FE310: Machine started.
17:22:24.4610 [NOISY] cpu: Trying to find the mapping for offset 0x20010000.
17:22:24.4703 [NOISY] cpu: Allocated 24B pointer at 0x1942033052672.
17:22:24.4703 [NOISY] cpu: Allocated is now 69.46MiB.
17:22:24.4794 [NOISY] cpu: Allocated 48B pointer at 0x1942036262368.
17:22:24.4794 [NOISY] cpu: Allocated is now 69.46MiB.
17:22:24.4794 [NOISY] cpu: Allocated 24B pointer at 0x1942033052256.
17:22:24.4794 [NOISY] cpu: Allocated is now 69.46MiB.
17:22:24.4794 [NOISY] cpu: Allocated 24B pointer at 0x1942033052224.
17:22:24.4794 [NOISY] cpu: Allocated is now 69.46MiB.
17:22:24.4794 [NOISY] cpu: Allocated 24B pointer at 0x1942033052288.
17:22:24.4794 [NOISY] cpu: Allocated is now 69.46MiB.
17:22:24.4794 [NOISY] cpu: Deallocated a 24B pointer at 0x1942033052672.
17:22:24.4794 [NOISY] cpu: Memory mappings rebuilt, there are 1 host blocks now.
17:22:24.4794 [NOISY] cpu: Allocated 32.02KiB pointer at 0x1942036801616.
17:22:24.4794 [NOISY] cpu: Allocated is now 69.49MiB.
17:22:24.4794 [NOISY] cpu: Allocated 24KiB pointer at 0x1942036834416.
17:22:24.4794 [NOISY] cpu: Allocated is now 69.51MiB.
17:22:24.4794 [WARNING] cpu: Reading from CSR #1985 that is not implemented.
17:22:24.4794 [NOISY] cpu: Trying to find the mapping for offset 0x80000000.
17:22:24.4794 [NOISY] cpu: Allocated 48B pointer at 0x1942036264288.
17:22:24.4794 [NOISY] cpu: Allocated is now 69.51MiB.
17:22:24.4794 [NOISY] cpu: Allocated 48B pointer at 0x1942036262304.
17:22:24.4794 [NOISY] cpu: Allocated is now 69.51MiB.
17:22:24.4794 [NOISY] cpu: Allocated 48B pointer at 0x1942036264160.
17:22:24.4794 [NOISY] cpu: Allocated is now 69.51MiB.
17:22:24.4794 [NOISY] cpu: Allocated 48B pointer at 0x1942036262560.
17:22:24.4794 [NOISY] cpu: Allocated is now 69.51MiB.
17:22:24.4794 [NOISY] cpu: Allocated 48B pointer at 0x1942036264224.
17:22:24.4794 [NOISY] cpu: Allocated is now 69.51MiB.
17:22:24.4794 [NOISY] cpu: Deallocated a 24B pointer at 0x1942033052256.
17:22:24.4794 [NOISY] cpu: Deallocated a 24B pointer at 0x1942033052224.
17:22:24.4794 [NOISY] cpu: Deallocated a 24B pointer at 0x1942033052288.
17:22:24.4794 [NOISY] cpu: Deallocated a 48B pointer at 0x1942036262368.
17:22:24.4794 [NOISY] cpu: Deallocated a 48B pointer at 0x1942036264288.
17:22:24.4794 [NOISY] cpu: Memory mappings rebuilt, there are 2 host blocks now.
17:22:24.4981 [WARNING] sysbus: [cpu: 0x20013538] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.4981 [WARNING] sysbus: [cpu: 0x20013542] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.4981 [WARNING] sysbus: Write of value 0xFFFEFFFF to an unimplemented register PRIC:PLLCFG (0x10008008) generated from SVD.
17:22:24.4981 [WARNING] sysbus: [cpu: 0x2001354C] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.5099 [WARNING] sysbus: Read from an unimplemented register PRIC:HFXOSCCFG (0x10008004), returning a value from SVD: 0x0.
17:22:24.5099 [WARNING] sysbus: [cpu: 0x200135EC] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.5099 [WARNING] sysbus: Write of value 0xFFFFFFFF to an unimplemented register PRIC:PLLCFG (0x10008008) generated from SVD.
17:22:24.5099 [WARNING] sysbus: [cpu: 0x200136A2] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.5110 [WARNING] sysbus: Write of value 0xFFFFFFFF to an unimplemented register PRIC:PLLCFG (0x10008008) generated from SVD.
17:22:24.5110 [WARNING] sysbus: [cpu: 0x200136EC] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.5110 [WARNING] sysbus: Read from an unimplemented register PRIC:PLLOUTDIV (0x1000800C), returning a value from SVD: 0x0.
17:22:24.5110 [WARNING] sysbus: Read from an unimplemented register PRIC:HFXOSCCFG (0x10008004), returning a value from SVD: 0x0.
17:22:24.5110 [WARNING] sysbus: [cpu: 0x20013422] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.5110 [WARNING] sysbus: [cpu: 0x2001342C] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.5119 [WARNING] sysbus: Write of value 0xFFFEFFFF to an unimplemented register PRIC:PLLCFG (0x10008008) generated from SVD.
17:22:24.5119 [WARNING] sysbus: [cpu: 0x2001343A] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.5119 [WARNING] sysbus: Write of value 0xFFFFFFFF to an unimplemented register PRIC:PLLCFG (0x10008008) generated from SVD.
17:22:24.5119 [WARNING] sysbus: [cpu: 0x20013538] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.5119 [WARNING] sysbus: [cpu: 0x20013542] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.5119 [WARNING] sysbus: Write of value 0xFFFEFFFF to an unimplemented register PRIC:PLLCFG (0x10008008) generated from SVD.
17:22:24.5129 [WARNING] sysbus: [cpu: 0x2001354C] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.5129 [WARNING] sysbus: Read from an unimplemented register PRIC:HFXOSCCFG (0x10008004), returning a value from SVD: 0x0.
17:22:24.5129 [WARNING] sysbus: [cpu: 0x200135EC] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.5129 [WARNING] sysbus: Write of value 0xFFFFFFFF to an unimplemented register PRIC:PLLCFG (0x10008008) generated from SVD.
17:22:24.5139 [WARNING] sysbus: [cpu: 0x200136A2] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.5139 [WARNING] sysbus: Write of value 0xFFFFFFFF to an unimplemented register PRIC:PLLCFG (0x10008008) generated from SVD.
17:22:24.5139 [WARNING] sysbus: [cpu: 0x200136EC] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.5139 [WARNING] sysbus: Read from an unimplemented register PRIC:PLLOUTDIV (0x1000800C), returning a value from SVD: 0x0.
17:22:24.5139 [WARNING] sysbus: Read from an unimplemented register PRIC:HFXOSCCFG (0x10008004), returning a value from SVD: 0x0.
17:22:24.5139 [WARNING] sysbus: [cpu: 0x200136EC] (tag: 'PRCI_PLLCFG') ReadDoubleWord from non existing peripheral at 0x10008008, returning 
0xFFFFFFFF.
17:22:24.5139 [WARNING] sysbus: Read from an unimplemented register PRIC:PLLOUTDIV (0x1000800C), returning a value from SVD: 0x0.
17:22:24.5139 [WARNING] sysbus: Read from an unimplemented register PRIC:HFXOSCCFG (0x10008004), returning a value from SVD: 0x0.
17:22:24.5328 [WARNING] uart0: Unhandled write to offset 0x18. Unhandled bits: [16-31] when writing value 0xFFFFFFFF. Tags: RESERVED (0xFFFF).
17:22:24.5433 [WARNING] gpioInputs: Unhandled read from offset 0x3C.
17:22:24.5589 [WARNING] gpioInputs: Unhandled write to offset 0x3C, value 0x0.
17:22:24.5589 [WARNING] gpioInputs: Unhandled read from offset 0x38.
17:22:24.5589 [WARNING] gpioInputs: Unhandled write to offset 0x38, value 0x30000.
17:22:24.5609 [WARNING] gpioInputs: Unhandled write to offset 0x40, value 0x680000.
17:22:24.5619 [WARNING] gpioInputs: Trying to write a pin that isn't configured for writing. Skipping.
17:22:24.5619 [WARNING] gpioInputs: Trying to write a pin that isn't configured for writing. Skipping.
17:22:24.5629 [WARNING] gpioInputs: Trying to write a pin that isn't configured for writing. Skipping.
...
17:22:24.5639 [WARNING] gpioInputs: Trying to write a pin that isn't configured for writing. Skipping.
...
17:22:24.5649 [WARNING] gpioInputs: Trying to write a pin that isn't configured for writing. Skipping.
...
17:22:24.5746 [WARNING] gpioInputs: Trying to write a pin that isn't configured for writing. Skipping.
17:22:24.5756 [WARNING] gpioInputs: Trying to write a pin that isn't configured for writing. Skipping.
...
17:22:24.5766 [NOISY] plic: Setting GPIO number #27 to value True
17:22:24.5766 [NOISY] plic: Setting state to True for source #27
17:22:24.5766 [WARNING] gpioInputs: Trying to write a pin that isn't configured for writing. Skipping.
...
17:22:24.6111 [WARNING] gpioInputs: Trying to write a pin that isn't configured for writing. Skipping.
17:22:24.6111 [WARNING] gpioInputs: Trying to write a pin that isn't configured for writing. Skipping.
17:22:24.6121 [WARNING] gpioInputs: Trying to write a pin that isn't configured for writing. Skipping.
...
17:22:24.6126 [WARNING] gpioInputs: Trying to write a pin that isn't configured for writing. Skipping.
...
17:22:24.6126 [NOISY] plic: Setting GPIO number #27 to value False
17:22:24.6126 [NOISY] plic: Setting state to False for source #27
17:22:24.6126 [WARNING] gpioInputs: Trying to write a pin that isn't configured for writing. Skipping.
...

References:

  1. Integrate Renode in PlatformIO
  2. Develop RISC-V application with PlatformIO + Renode
  3. Renode startup guide
  4. Documentation for SiFive Freedom Metal library
  5. SiFive Official website - Find important docs below

Please guide me. Thank you for your time.

Upvotes: -4

Views: 46

Answers (0)

Related Questions