Skip to content

PWMAudio Crashing #2431

Closed Answered by earlephilhower
ScullyE asked this question in Q&A
Sep 9, 2024 · 1 comments · 6 replies
Discussion options

You must be logged in to vote

This is an alignment issue because your array is a char and you're reading int16_t. GCC is giving your array an odd address (perfectly legal for char but illegal for int16_t). Export your WAV as 16-bits (might be a pain) or align the array to a 2-byte boundary using

const unsigned char out_raw[] __attribute__((aligned((2)))) = {

While you saw it with Serial this really could be cause by even having a single global variable anywhere in the app. The alignment primitive will take care of this.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@ScullyE
Comment options

@earlephilhower
Comment options

@ScullyE
Comment options

@earlephilhower
Comment options

Answer selected by ScullyE
@earlephilhower
Comment options

@ScullyE
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants