Coder Social home page Coder Social logo

casanovg / timonel Goto Github PK

View Code? Open in Web Editor NEW
110.0 11.0 17.0 259.88 MB

ATtiny85/45/25 I2C bootloader

License: MIT License

Shell 3.78% Makefile 14.28% Assembly 0.20% C 80.85% Ruby 0.61% Python 0.27%
i2c-bootloader i2c-bus timonel-bootloader firmware attiny85 attiny84 arduino universal-serial-interface microcontroller usi

timonel's People

Contributors

casanovg avatar prandeamus avatar smn321 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

timonel's Issues

make-timonel.sh under Linux

"make-timonel-sh" doesn't execute under Linux (more properly when I use it from bash shell)

./make-timonel.sh: 40: ./make-timonel.sh: function: not found
(then the "Usage text"
./make-timonel.sh: 79: ./make-timonel.sh: Syntax error: "}" unexpected

Problem seems to be line 1 hash-bang

#!/bin/sh

If I change this #!/bin/bash, it works

I suspect that your development environment regards bash and sh as functionally equivalent. but for me sh and bash are different executables. Lordy, lordy, I love Unix but how many shells can one operating system need? The documentation says that sh is synonym for dash, but that bash is different. Presumably my sh (dash) doesn't like your function syntax.... argggh. Workaround for me is to edit line 1. as noted above. I'm not really sure what linux best practice is here, and if there some incantation which always picks the right shell? I didn't want to submit a PR not knowing best practice.

As a sanity check, the sample output for ./make-timonel.sh tml-t85-small timonel 13 1B80 1 false is attached below.


  • Starting Timonel compilation with these parameters:

  • Configuration: tml-t85-small
  •  Binary file: timonel.hex
    
  •  TWI address: 13
    
  • Flash position: 1B80 <- In case of errors, use lower positions!
  • CPU clock speed: 1 MHz <- RC OSC (low fuse = 0x62)
  • Auto clock tweak: false

RUNNING: make all CONFIG=tml-t85-small TARGET=timonel TIMONEL_TWI_ADDR=13 TIMONEL_START=1B80 LOW_FUSE=0x62 AUTO_CLK_TWEAK=false

========================================================================

Building Timonel configuration: tml-t85-small
TIMONEL_START = 0x1B80
========================================================================
... ENABLE_LED_UI = false
... AUTO_PAGE_ADDR = false
... APP_USE_TPL_PG = false
... CMD_SETPGADDR = true
... TWO_STEP_INIT = false
... USE_WDT_RESET = false
... APP_AUTORUN = false
... CMD_READFLASH = false
... CMD_READDEVS = false
... EEPROM_ACCESS = false
-----------------------------------------------------------------------
... AUTO_CLK_TWEAK = false
... LOW_FUSE = 0x62
... LED_UI_PIN = PB1

[Sections]
text data bss dec hex filename
896 0 198 1094 446 timonel.bin

[Hexfile] Take "data" size to calculate the bootloader's start address!
text data bss dec hex filename
0 896 0 896 380 timonel.hex

error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode

Should i add -std=c99?

root@bananapim2zero:~/timonel/timonel-bootloader# make
tml-bootloader.c: In function ‘main’:
tml-bootloader.c:200:25: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0; i < PAGE_SIZE - 2; i += 2) {
^
tml-bootloader.c:200:25: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
tml-bootloader.c: In function ‘ReceiveEvent’:
tml-bootloader.c:247:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (byte i = 0; i < commandBytes; i++) {
^
tml-bootloader.c: In function ‘RequestEvent’:
tml-bootloader.c:293:13: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (byte i = 0; i < GETTMNLV_RPLYLN; i++) {
^
tml-bootloader.c:347:17: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (byte i = 3; i < (RXDATASIZE + 1); i += 2) {
^
tml-bootloader.c:354:17: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (byte i = 1; i < (RXDATASIZE + 1); i += 2) {
^
tml-bootloader.c:364:13: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (byte i = 0; i < WRITPAGE_RPLYLN; i++) {
^
Makefile:55: recipe for target 'tml-bootloader.o' failed
make: *** [tml-bootloader.o] Error 1

sketch for attiny85 firmware upload by air.

Please write a sketch for attiny85 firmware upload by air.
There are many sketches of flashing esp8266 itself on wifi. .
Task: esp8266 get the firmware via wifi and upload it to your slave ittiny85 via i2c.

Thanks in advance.

Feature request for bootloader (if it possible)

Dear Gustavo,

It is a very good feature, thank you! I have a new feature request:

I will make more than one attiny85 module (but i don't know how many pieces, about 3-4 variety but summary about 30 attiny85 module per board), but i don't want a make fix i2c slave address for the bootloader. So, my question: is it possible that the bootloader check the free i2c slave address, and if got it a free address reserve it? (the currently range is ok)

Summary:

  • attiny85 power on
  • Started the bootloader
  • Bootloader firstly runs an "i2cdetect" and search an free i2c address
  • if found it then reserved it, and then more works as i2c slave.
  • and the currently processing running.

Thank You,
Gabor

syntax error in bash script

In flash-timonel-bootloader.sh running under Linux (it's a 64-bit Ubuntu derivative) the line following
echo "[[[ Flashing Timonel for operating @ $ARG2 MHz ]]]";
is

avrdude -c USBasp -p attiny85 -B3 -U flash:w:.\releases\$ARG1.hex:i -B 20 -U lfuse:w:$LOW_FUSE:m -U hfuse:w:$HIGH_FUSE:m -U efuse:w:$EXTENDED_FUSE:m;

This breaks my bash script. I assume you mean to use / rather than \ here?
avrdude -c USBasp -p attiny85 -B3 -U flash:w:./releases/$ARG1.hex:i -B 20 -U lfuse:w:$LOW_FUSE:m -U hfuse:w:$HIGH_FUSE:m -U efuse:w:$EXTENDED_FUSE:m;

The backslash makes me wonder that perhaps you use Windows with a bash emulation of some kind which allows \ as a path separator, but "real" Linux file systems are more fussy. I make the change and the script runs to completion without errors.

Bash version
GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)

uname -a reports
Linux robert-ThinkPad-S3-Yoga-14 5.4.0-72-generic #80~18.04.1-Ubuntu SMP Mon Apr 12 23:26:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.