Code Monkey home page Code Monkey logo

Comments (4)

xobs avatar xobs commented on July 24, 2024

Thanks for reporting this.

It appears to be an issue with libopencm32. Specifically, the usbd_poll() function -- if you disable the USB ISR, it works just fine.

I'm without my debugger right now, so I'll see how much debugging I can do. It certainly feels like 18.04 got aggressive when it comes to packing, and maybe some struct got not-word-aligned.

from tomu-quickstart.

xobs avatar xobs commented on July 24, 2024

Ubuntu 18.04 is completely broken.

Their memcpy() jumps to an address that doesn't exist:

xobs@Pazuzu:~/Code/Tomu/quickstart/usb-hid$ gdb-multiarch usb-hid.elf
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from usb-hid.elf...done.
(gdb) disassemble memcpy,+4
Dump of assembler code from 0x5950 to 0x5954:
   0x00005950 <memcpy+0>:       movs    r7, r1
   0x00005952 <memcpy+2>:       b.n     0x5ffa
End of assembler dump.
(gdb) x 0x5ffa
0x5ffa: Cannot access memory at address 0x5ffa
(gdb)

You may need to try a different compiler.

from tomu-quickstart.

xobs avatar xobs commented on July 24, 2024

Upstream bug: https://bugs.launchpad.net/ubuntu/+source/gcc-arm-none-eabi/+bug/1767223

The issue is that it's ignoring the -mcpu=cortex-m0plus and linking in the desktop version of libc, which contains ARM instructions. The Cortex M-series only supports Thumb2 instructions, so any time you call any standard library function the program will crash.

from tomu-quickstart.

xobs avatar xobs commented on July 24, 2024

Workaround to fix the issue on Ubuntu 18.04 LTS (courtesy of @madhacker on #tomu): bbcmicrobit/micropython#514 (comment)

from tomu-quickstart.

Related Issues (20)

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.