sohotcall

Arduino-CLI Nano Clone ATMega328P, Bonus STM32Duino

Oct 9th, 2018
144
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Install Arduino-CLI
  2. -------------------
  3. $ curl http://downloads.arduino.cc/arduino-cli/arduino-cli-0.2.0-alpha.preview-linux64.tar.bz2 -o arduino-cli.bz2
  4. $ tar -xvf arduino-cli.bz2
  5. $ mv arduino-cli-linux64 arduino-cli
  6. $ mkdir $HOME/Arduino
  7. $ mkdir $HOME/.arduino15
  8.  
  9. Install Arduino Nano Board
  10. --------------------------
  11. $ ./arduino-cli core update-index
  12. $ ./arduino-cli core install arduino:avr
  13. $ ./arduino-cli board listall
  14.  
  15. Make Compile and Upload sketch
  16. ------------------------------
  17. $ ./arduino-cli sketch new test
  18. $ nano $HOME/Arduino/test
  19. $ ./arduino-cli compile --fqbn arduino:avr:nano:cpu=atmega328old $HOME/Arduino/test
  20. $ ./arduino-cli board list
  21. $ sudo ./arduino-cli upload -p /dev/ttyUSB0 --fqbn arduino:avr:nano:cpu=atmega328old $HOME/Arduino/test2
  22.  
  23. Install STM32Duino For STM32F103C8T6
  24. ------------------------------------
  25. $ ./arduino-cli config dump >.cli-config.yml
  26. $ nano .cli-config.yml
  27. proxy_type: auto
  28. sketchbook_path: /home/gungsukma/Arduino
  29. arduino_data: /home/gungsukma/.arduino15
  30. board_manager:
  31. additional_urls:
  32. - http://dan.drown.org/stm32duino/package_STM32duino_index.json
  33. --------------------- Warning: NO TABS!
  34. $ ./arduino-cli core update-index
  35. $ ./arduino-cli core install stm32duino:STM32F1
  36. $ nano $HOME/.arduino15/packages/stm32duino/hardware/STM32F1/2018.7.2/boards.txt
  37. -------------------------- Replace These
  38. genericSTM32F103C.build.flags.optimize=-Os
  39. genericSTM32F103C.build.flags.ldspecs=
  40.  
  41. ## STM32F103C8
  42. genericSTM32F103C.menu.device_variant.STM32F103C8=STM32F103C8 (20k RAM. 64k Fla$
  43. genericSTM32F103C.build.cpu_flags=-DMCU_STM32F103C8
  44. genericSTM32F103C.build.ldscript=ld/jtag_c8.ld
  45. genericSTM32F103C.menu.device_variant.STM32F103C8.upload.maximum_size=65536
  46. genericSTM32F103C.menu.device_variant.STM32F103C8.upload.maximum_data_size=20480
  47. -----------------------------
  48. $ ./arduino-cli compile -v -b stm32duino:STM32F1:genericSTM32F103C $HOME/Arduino/test
  49. $ ./arduino-cli board list
  50. $ ./arduino-cli upload -p /dev/ttyACM0 --fqbn stm32duino:STM32F1:genericSTM32F103C $HOME/Arduino/test
  51.  
  52. Flash STM32Duino Via USB to Serial
  53. ----------------------------------
  54. sudo /home/gungsukma/.arduino15/packages/stm32duino/tools/stm32tools/2018.7.2/linux/stm32flash/stm32flash -g 0x8000000 -b 115200 -w ~/Arduino/test/test.stm32duino.STM32F1.genericSTM32F103C.bin /dev/ttyUSB0
  55. stm32flash Arduino_STM32_0.9
RAW Paste Data