arduino / arduino/ArduinoCore-mbed
Increase Stack size
- Dominant language
- C
- Stars
- 411
- Forks
- 225
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I'm working with a sketch using alternatively two libraries to handle external devices (a CD2003GP or a Si473X receiver), the first requires almost nothing and the second requires to include at compile a rather large library. The program uses USB to read and write digital audio samples from/to a PC based program.
When trying to read samples from the PC in the first (light) configuration it works ok whilst in the second it just hangs immediately, the involved libraries aren't participating at the hang execution point, which is the middle of a memory transfer loop.
```
void USBread() {
_INFO("Reading transmission\n");
USB_read = audio.read(myRawBuffer, sizeof(myRawBuffer));
_INFO("USB read yield (%s) buffer(%d)\n",BOOL2CHAR(USB_read),sizeof(myRawBuffer));
if (USB_read) {
int16_t *lessRawBuffer = (int16_t *)myRawBuffer;
for (int i = 0; i < 24; i++) {
// the left value;
int16_t outL = *lessRawBuffer;
lessRawBuffer++;
// the right value
int16_t outR = *lessRawBuffer;
lessRawBuffer++;
//mono value
int16_t mono = (outL + outR) / 2;
monodata[i] = mono;
_INFO("Transferred byte[%d]\n",monodata[i]); //When hanging never reach this debug message
}
_INFO("Buffer completed\n");
}
}
```
This kind of behaviour I saw to be associated with either memory heap or stack space, unlikely to be the first it might be the second.
¿Is there a way to increase the stack size using the mbed library?
Thanks in advance, Pedro
Contributor guide
No contributing guide indexed for this repository
Research direction
The report names the USBread() function but no repository file, test, or board. Start by reproducing the hang with the two library configurations, then trace the ArduinoCore-mbed stack configuration used by the sketch. Done means identifying the applicable stack setting and validating the change with the reported USB transfer loop.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100