PreArm: logging fail 3.6.2

I have the “LOG_BACKEND_TYPE” parameter set to 1 and the error appears regularly.

Hi,
3.6.2 Chibios or NuttX ?
Which FC ?

Chibios

Pix4Pilot from HobbyKing with 1GB SD Card

I think it is Chibios, I am not sure. When instaling 3.6.2 there was a question about updating Chibios

Re-load 3.6.2 without ChibiOS, or try a fast SD-card. My logging issues disappeared when I plugged in a 32GB U1 Samsung uSD, but others still encountered the error after switching to SanDisk U1 cards
It only happens on ChibiOS, and it disappears if, after powering up, you do an I/O reset using the built-in switch.
DEV-team has it on the to-do list, but I think their plate is full, and it only happens on some clones and not others.

IO reset or FMU reset?

set LOG_FILE_BUFSIZE to 8

1 Like

It worked! The message disappeared .

1 Like

It used to work with I/O reset. No more I/O thread heartbeat and Bad logging messages. But I tried it today with a no-name uSD and reset won’t help anymore. Neither I/O nor FMU reset solves the problem. I’m baffled.

Them damn clones with resistors in place of level-shifters and other cheap shortcuts.

@ThePara could you try setting the LOG_FILE_BUFSIZE change?

I found that this problem started at AC3.61,Whenever set LOG_FILE_BUFSIZE to 16 that TF card will appearance of the message"PreArm":logging fail" or FC starting failed. I think this is a problem form AC3.61 on Chibios.

@peterbarker of course I tried. No candy.

LOG_BUFFER_SIZE did not help me. Also tried 4. I only have SanDisk SDs. I can try a Samsung card. Any time I run Chibios I get the message unless I’m plugged into usb. I believe it’s related to the voltage at startup. I think I’ll try to figure this one out since I can reproduce it very easily.

It’s not the brand that matters, it’s the speed. Search for an SD that’s certified for speed. U1, U3 if possible.
I used to fly and record with one of the first Sony 4K handhelds, the AX100, which was very fiddly regarding the cards. I think it was actually testing their speeds when inserted because on many it was refusing to switch from HD 30 fps to either HD 60 fps or 4K 30 fps.
Anyway, SanDisk may be a better target for chinese lo-quality cloners then more obscure SD manufacturers.

I am still seeing logging fails with a sandisk extreme u3, the reccomended card, It only happens on Chibios, but with blheli32 escs that is really my only choice now, It has to be an initialization problem somewhere. If I reboot it’s fine (not power cycle). If I power from USB it’s fine. I only see issues when powering via the power connector or rail. I’m trying to get some debugging info on this, adding print statements here and there.

I’m pretty sure this problem is related to ChibiOS, it is a known issue, has nothing to do with the microSD card. I’m pretty sure @tridge is aware of it and will be addressing it. It is not a critical failure, as most times rebooting the controller will “fix” it. If you ignore the issue by disabling the checks, arm and fly, it does nothing bad other than get a 4kB log file with nothing in it. It doesn’t affect anything else that I have ever found.

This came up on the dev call this-morning; see the notes (when they
appear) for things tridge will be trying next.

1 Like

With ChiBios, after changing parameters and trying genuine and chinese µSD cards of several sizes, I found that with a particularily critical Micro Pix controller it booted completely and always with two particular uncharacterized chinese 1GB cards and one chinese uncharacterized 2 GB card. No genuine characterized fast card worked. No problem in NuttX.

Among the ones failing were three 1GB chinese cards.

Observe that the five 1GB cards (FAT16, 16K clusters, no deffects) report different sizes. The two over 1e9 bytes work.

Go figure. This should be solved eventually, but if it relates to ChiBios internals may take longer.

I tracked this down to three problems. “Bad Logging” comes from frsky_passthru and ha.ppens because no logging happens until you arm. unless you request it. “Logging Failed” Im not sure about yet, and “IO Thread Heartbeat” is only dataflash related and should only be generated once instead of multiple times, if a logging problem really exists. I’ll fix these if I can, or at least let people know why they occur and their IO main thread isn’t shutting down. That’s what I thought until I looked. Oh yeah, there are not any errors with USB plugged in because most of the tests are bypassed. It has nothing to do with the type of card, voltage, or any other bad reason. I’ll also try to figure out why nuttx is different, but I suspect it’s a minor difference in the order some of the modules get setup.

2 Likes

Hello,

I’m still getting the “PreArm: Logging failed” error.
(this error suddenly appeared with some firmware update, I still use the same setup)

ChibiOS: d2030d88
ArduCopter V3.6.5 (d37125bd)