See cpukit/libcsupport/src/malloc_deferred.c. It is definitely returning NULL because you shouldn't malloc from an ISR. malloc() is a non-deterministic operation. I am surprised that code was designed to do that.
Perhaps this code assumes the USB interrupt is serviced from a thread. The raw interrupt unblocks a thread to run this code. --joel On Mon, Dec 11, 2017 at 6:36 PM, Mr. Andrei Chichak <gro...@chichak.ca> wrote: > (sorry if this ended up on the Devel list.) > > I’m working with ST’s HAL USB stack, and to initialize the various > structures, they use a USB interrupt as a trigger. > > In this interrupt, they malloc some space for a descriptor (504 bytes). > > The RTEMS malloc always returns 0. > > Is there a guard against calling malloc in an interrupt context? > > I managed to get around the problem by doing a static allocation, but I > was just wondering. > > > Andrei > > _______________________________________________ > users mailing list > users@rtems.org > http://lists.rtems.org/mailman/listinfo/users
_______________________________________________ users mailing list users@rtems.org http://lists.rtems.org/mailman/listinfo/users