Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ILI9341 TFT driver (SPI) for ATSAMD2x #174

Merged
merged 3 commits into from
Aug 3, 2020

Conversation

sago35
Copy link
Member

@sago35 sago35 commented Jul 19, 2020

No description provided.

@sago35
Copy link
Member Author

sago35 commented Jul 19, 2020

I haven't added the pyportal_boring setting because 32KB of memory is not enough.

$ tinygo flash -target xiao -size short ./examples/ili9341/basic/
   code    data     bss |   flash     ram
  11716       8    4300 |   11724    4308
$ tinygo flash -target xiao -size short ./examples/ili9341/scroll/
   code    data     bss |   flash     ram
  11780       8    4300 |   11788    4308
$ tinygo flash -target xiao -size short ./examples/ili9341/pyportal_boing/
tinygo:ld.lld: error: section '.bss' will not fit in region 'RAM': overflowed by 2717 bytes
tinygo:ld.lld: error: section '.bss' will not fit in region 'RAM': overflowed by 2720 bytes
tinygo:ld.lld: error: section '.bss' will not fit in region 'RAM': overflowed by 2717 bytes
tinygo:ld.lld: error: section '.bss' will not fit in region 'RAM': overflowed by 2720 bytes
tinygo:ld.lld: error: section '.bss' will not fit in region 'RAM': overflowed by 2717 bytes
tinygo:ld.lld: error: section '.bss' will not fit in region 'RAM': overflowed by 2720 bytes
failed to run tool: ld.lld
error: failed to link /tmp/tinygo178178479/main: exit status 1

I rewrote targets/atsamd21.ld to check for memory requirements and found the following became
pyprotal_boing won't work unless you split the frame_buffer or make other changes.

$ tinygo build -o app.elf -target xiao -size full ./examples/ili9341/pyportal_boing/
   code  rodata    data     bss |   flash     ram | package
   4356      13       0       0 |    4369       0 | (bootstrap)
      0      36       0       0 |      36       0 | handleHardFault$string
    100      24       0       4 |     124       4 | internal/task
   3252      50       5    2054 |    3307    2059 | machine
      0      16       0     130 |      16     130 | machine$alloc
   2698      97       0      33 |    2795      33 | runtime
    216       0       0       0 |     216       0 | time
   2680   16463       0   31175 |   19143   31175 | tinygo
  13302   16699       5   33396 |   30006   33401 | (sum)
  30296       -       8   35472 |   30304   35480 | (all)

@deadprogram
Copy link
Member

I do not have the hardware myself to test this, but looks good to me @sago35 thank you for working on this.

Now squash/merging.

@deadprogram deadprogram merged commit 5a75c9c into tinygo-org:dev Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants