microcontroller pin-compatibil

O porcarie. Bineinteles, nu merge. De ce ar merge, doar nu-i ca si cum cineva ar testa ceva vreodata inainte sa ia banii de la prostii care cumpara?

Programul demo "Blink" din Arduino IDE:
Code:
In file included from /usr/share/arduino/hardware/arduino/avr/cores/arduino/Arduino.h:258:0,
                 from /tmp/arduino_build_105123/sketch/Blink.ino.cpp:1:
/home/marius95/.arduino15/packages/groundstudio-jade/hardware/avr/1.0.4/variants/jade-nanoplus/pins_arduino.h: In function ...void analogWrite328PB(uint8_t, int)...:
/home/marius95/.arduino15/packages/groundstudio-jade/hardware/avr/1.0.4/variants/jade-nanoplus/pins_arduino.h:231:7: error: ...PORTD... was not declared in this scope
       PORTD |= (1 << 2);
       ^
/home/marius95/.arduino15/packages/groundstudio-jade/hardware/avr/1.0.4/variants/jade-nanoplus/pins_arduino.h:236:7: error: ...PORTD... was not declared in this scope
       PORTD &= ~(1 << 2);
       ^
exit status 1
Error compiling for board GroundStudio Jade Nano+.
Daca nici Blink nu merge, cand o fi vorba de intreruperi, timere, low power sleep, etc. ce sanse sa fac ceva functional mai sunt?

Le-am trimis mail, dar nu-mi fac iluzii.
 
Adică ăsta, care se compilează fără probleme?

1726322486430.png
 
Ei bine, la mine nu merge. Este pe Raspbian bookworm downloadat saptamana trecuta, fara nimic customizat in stilul Marius'95, doar scris pe card, bootat, instalat IDE si instalat placa conform instructiunilor.
 
Păi și să alegi dintre toate linuxurile (care oricum au câteva procente de desktop users) Raspbian, care are câteva procente de utilizatori dintre ăia pe linux tot stilul Marius'95 mi se pare.

Același program pe platformă arduino standard se compilează?
 
Si care linux ar fi trebuit sa-l folosesc? Arbian? Ubuntu arm? Gentoo am incercat deja si nu merge din alte motive.
Pentru Arduino Yun se compileaza.
 
Last edited:
Dupa multe multe muuulte trial & error, intr-un final, merge:
Code:
/build/avr $ cat blink.c
#include <avr/io.h>

int main(void){
DDRB=0xFF;
PORTB=0x0;
unsigned int i;
while(1){
  for(i=32768; i; i--){}
  PORTB=0x20;
  for(i=65535; i; i--){}
  PORTB=0x0;
} //while
} //main
/build/avr $ avr-gcc -mmcu=atmega328p -Wall -o blink.elf blink.c
/build/avr $ avr-objcopy -O ihex -R .eeprom blink.elf blink.hex
avrdude -P /dev/ttyACM0 -v -v -c arduino -p m328pb -U flash:w:blink.hex:i

avrdude: Version 7.2
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is /etc/avrdude.conf
         User configuration file is /home/marius95/.avrduderc
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : arduino
         AVR Part                      : ATmega328PB
         Chip Erase delay              : 10500 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : possible i/o
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                           Block Poll               Page                       Polled
           Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom                 65    20     4    0 no       1024    4      0  3600  3600 0x00 0x00
           flash                  65    10   128    0 yes     32768  128    256  4500  4500 0x00 0x00
           lfuse                   0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
           hfuse                   0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
           efuse                   0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
           lock                    0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
           signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00
           calibration             0     0     0    0 no          1    1      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino for bootloader using STK500 v1 protocol
         Hardware Version: 3
         Firmware Version: 4.4
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00 s
avrdude: device signature = 0x1e9516 (probably m328pb)
avrdude: Note: flash memory has been specified, an erase cycle will be performed.
         To disable this feature, specify the -D option.
avrdude: erasing chip

avrdude: processing -U flash:w:blink.hex:i
avrdude: reading input file blink.hex for flash
         with 236 bytes in 1 section within [0, 0xeb]
         using 2 pages and 20 pad bytes
avrdude: writing 236 bytes flash ...
Writing |                                                    | 0% 0.00 s
avrdude: padding flash [0x0080, 0x00ff]
Writing | ################################################## | 100% 0.04 s
avrdude: 236 bytes of flash written
avrdude: verifying flash memory against blink.hex
avrdude: reading on-chip flash data ...
Reading | ################################################## | 100% 0.02 s
avrdude: verifying ...
avrdude: 236 bytes of flash verified

avrdude done.  Thank you.

/build/avr $
... si placuta se beculeste vesel. :bravo:

Acum pot sa dezinstalez Arduino IDE.
 
Pai ar fi trebuit s-o scriu, sau daca e deja scrisa de altcineva, ar trebui sa-o caut daca e instalata, unde e, cum se importa, cum se foloseste si, mai precis, ce face.
2 linii cu "for" imi ia mai putin timp decat ambele variante.
 
Back
Top