Post Reply 
HP41 TULIP4041 update
12-08-2024, 03:23 AM (This post was last modified: 12-08-2024 03:32 AM by foldedtoad.)
Post: #55
RE: HP41 TULIP4041 update
I am seeing an alignment fault with TULIP when built on Ubuntu 22.04 + Pico-SDK.
I don't believe this is an issue with TULIP per-se, but rather something in the Pico-SDK.
I would be interested in hearing if others have experience a similar problem.

Some context:
Ubuntu 22.04 LTS
gcc 10.3.1 arm-none-eabi-gcc
Pico-SDK 2.0.0 (I know there is a newer version: 2.1.0, but not relevant here IMO)
newlib version 3.3.0-1.3 (newlib-arm-none-eabi) the library with memcpy() function.

Details:
The alignment fault occurs when the tinyusb module rp2040_usb.c function sync_ep_buffer() attempts a memcpy() from hw_data_buf (device memory) to user_buf (normal memory) for a length of 7 bytes (when receiving a CDC Set_Line_Coding packet on EP0). When the memcpy() attempts to copy the tail-end of the 7 bytes and used a LDRH asm instruction to load a half-word (16-bits) from device memory (USB Controller memory), the fault occurs.

If i replace the memcpy() call in sync_ep_buffer() with a byte-by-byte copy (for loop) in rp2040_usb.c, then I don't see this issue, as the half-word LDRH instruction is not used.
With this temporary workaround I have a working TULIP system.

I have also loaded the tullip4041.uf2 binary found in the github project and it works without problem.
This would indicate there is something in my build environment which is marking the Pico2/RP2350 USB Controller's device memory differently from how it is being build in a Windows environment.

Attached is a text file which shows the disassemble memcpy() for ARM V7.m.

https://raw.githubusercontent.com/folded..._debug.png


Attached File(s)
.txt  memcpy_armv7m.txt (Size: 3.31 KB / Downloads: 7)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP41 TULIP4041 update - MeindertKuipers - 08-23-2024, 02:01 PM
RE: HP41 TULIP4041 update - Sylvain Cote - 08-24-2024, 02:12 AM
RE: HP41 TULIP4041 update - John Ioannidis - 08-25-2024, 11:07 PM
RE: HP41 TULIP4041 update - Sylvain Cote - 08-25-2024, 11:46 PM
RE: HP41 TULIP4041 update - John Ioannidis - 08-29-2024, 03:32 AM
RE: HP41 TULIP4041 update - floppy - 10-07-2024, 04:35 PM
RE: HP41 TULIP4041 update - Sylvain Cote - 08-27-2024, 07:33 PM
RE: HP41 TULIP4041 update - jsi - 08-28-2024, 12:44 PM
RE: HP41 TULIP4041 update - Sylvain Cote - 08-28-2024, 12:54 PM
RE: HP41 TULIP4041 update - John Ioannidis - 08-30-2024, 01:44 AM
RE: HP41 TULIP4041 update - Sylvain Cote - 09-01-2024, 02:42 PM
RE: HP41 TULIP4041 update - Sylvain Cote - 10-15-2024, 05:56 PM
RE: HP41 TULIP4041 update - gege - 10-16-2024, 07:53 AM
RE: HP41 TULIP4041 update - born2laser - 10-17-2024, 11:34 PM
RE: HP41 TULIP4041 update - Craig Bladow - 10-27-2024, 07:44 PM
RE: HP41 TULIP4041 update - Craig Bladow - 10-28-2024, 05:13 PM
RE: HP41 TULIP4041 update - John Keith - 11-02-2024, 12:33 PM
RE: HP41 TULIP4041 update - GertSanders - 10-31-2024, 05:13 PM
RE: HP41 TULIP4041 update - foldedtoad - 11-02-2024, 07:04 PM
RE: HP41 TULIP4041 update - foldedtoad - 11-03-2024, 05:48 PM
RE: HP41 TULIP4041 update - Thomas Klemm - 11-03-2024, 07:13 PM
RE: HP41 TULIP4041 update - twoweims - 11-16-2024, 11:48 PM
RE: HP41 TULIP4041 update - born2laser - 11-17-2024, 05:48 PM
RE: HP41 TULIP4041 update - foldedtoad - 12-08-2024 03:23 AM
RE: HP41 TULIP4041 update - ThomasF - 12-09-2024, 06:40 AM
RE: HP41 TULIP4041 update - Hiwi - 12-09-2024, 11:40 AM
RE: HP41 TULIP4041 update - foldedtoad - Yesterday, 01:50 AM



User(s) browsing this thread: 3 Guest(s)