Hi,

Are you running this os_msys_get_pkthdr code on the same thread that
you're running the fsutil_write_file/fsutil_read_file?

I'm pretty sure there is a bug on the fsutil functions (which was not
triggered before) and I would suggest that you change temporarily both
functions to remove (comment out) the calls to "fs_close" just after the
"done:" label. The file in question is "fs/fs/src/fsutil.c".

Please do this change and check if it solves your problem.

Cheers,
Fabio Utzig

On Wed, Feb 15, 2017, at 12:58 AM, then yon wrote:
> Dear Chris,
> 
> After i tried on 3 NRF52_DK board, 1 of it worked!
> 
> This is really weird as the other 2 units only work if i disabled the 
> filesystem.
> 
> Do you have any clue on this?
> 
> Regards,
> 
> Then Yoong Ze
> 
> 
> On 15/2/2017 6:32 AM, then yon wrote:
> > Dear Chris,
> >
> > Thanks for your reply; i've made the changes below but i still get the 
> > same result.
> >
> > struct os_mbuf *om = os_msys_get_pkthdr(0, 0);
> >
> >     syscfg.vals:
> >         MSYS_1_BLOCK_COUNT: 100
> >     LOG_LEVEL: 1
> >     SHELL_TASK: 1
> >     SPI_0_SLAVE: 1
> >     CONFIG_NFFS: 1
> >
> > For the nffs part, even it can build and run without error but it 
> > doesn't write/read from file system correctly. (I've sent another post 
> > on this)
> >
> > Thank you.
> >
> > Regards,
> >
> > Then Yoong Ze
> >
> >
> > On 15/2/2017 12:48 AM, Christopher Collins wrote:
> >> Hi Then,
> >>
> >> On Tue, Feb 14, 2017 at 06:35:35PM +0800, then yon wrote:
> >>> Dear Support,
> >>>
> >>> I having issue with mqueue that the following code always return me
> >>> error after i update myNewt to developer version.
> >>>
> >>> struct os_mbuf *om = os_msys_get_pkthdr(0, sizeof(some_struct));
> >>>
> >>> if(om == NULL)
> >>> {
> >>>       console_printf("Spi err 02\n");
> >>>       return -2;
> >>> }
> >> I don't think this is the problem, but are you sure those arguments are
> >> correct?  Most calls to os_msys_get_pkthdr() should specify 0 for the
> >> second argument (user header length).
> >>
> >> You might just be out of mbufs.  You could try increasing the count of
> >> mbufs allocated to msys by adding this to your target's syscfg.yml file:
> >>
> >>      syscfg.vals:
> >>          MSYS_1_BLOCK_COUNT: 16
> >>
> >> This overrides the default value of 12 with 16.
> >>
> >>> By disabling nffs filesystem coding, it worked perfectly.
> >> Hmm... I don't know of any connection between nffs and the behavior
> >> you're seeing.  I don't believe nffs uses any mbufs.
> >>
> >> Chris
> >> .
> >>
> >
> 

Reply via email to