PMunch / ratel

128 stars 4 forks source link

ratel problem #17

Open Martinix75 opened 12 months ago

Martinix75 commented 12 months ago

Good morning, I wanted to try Ratle, to play a little with the "Arduino" that I have around the house / laboratory. I created the config.nims file


import boardConf
board "unor3"

--avr.any.gcc.path: "/home/andrea/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin" #"/usr/bin"

Which should be the valid way up to the AVR compiler (I hope). I try the example file that I call "rttTest.nim" within the "rttTest Directory.

import board
import board / [times, serial, progmem]

Serial.init(9600.Hz)
Serial.send p"Hello world\n"
Led.output()

while true:
  Led.high()
  Serial.send p"Led is on\n"
  delayMs(1000)
  Led.low()
  Serial.send p"Led is off\n"
  delayMs(1000) 

But after the "ratel ruild" command I get the following mistake:

andrea@tec-martin:~/Scrivania/rttTest> ratel build
Hint: used config file '/home/andrea/bin/nim/config/nim.cfg' [Conf]
Hint: used config file '/home/andrea/bin/nim/config/config.nims' [Conf]
Hint: used config file '/home/andrea/Scrivania/rttTest/config.nims' [Conf]
..........................................................................
/home/andrea/bin/nim/lib/pure/unicode.nim(849, 36) Error: type mismatch: got 'int32' for 'RuneImpl(toLower(ar)) - RuneImpl(toLower(br))' but expected 'int'
vmops.nim(7)             exec
Error: unhandled exception: nim c -d:danger --os:any rttTest.nim [OSError]
andrea@tec-martin:~/Scrivania/rttTest> ratel build

I'm wrong something sensational or do you come any problem in ratel? Good evening from Martin A. p.s i use NIM 2.0.0

PMunch commented 12 months ago

Just tested and it appears to be a Nim 2.0 breaking change. I'll hopefully have time to look at this tomorrow!

Martinix75 commented 10 months ago

Hi, have you been able to see (understand) the compilation problem? Thanks and sorry for the disorder

PMunch commented 10 months ago

Had a quick look at it today (sorry I had completely forgotten about this). Not entirely sure what the underlying issue is though. The unicode module the error is reported in doesn't appear to have changed, so my best guess is that something must've changed with type coercion on 16-byt architectures. I'm looking into it, hopefully I'll have a solution soon enough.

Martinix75 commented 10 months ago

A thousand thanks! Let's say that my real purpose, is to try some Libs that I wrote for RP2040, on Arduino, which feasible (according to me) with a few changes, but it would be interesting to try! In the meantime, thanks for your work!