Skip to content

make-timonel.sh under Linux #22

Open
@prandeamus

Description

@prandeamus

"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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingsolvedSolved issue

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions