Problems with barometer

Neither Ardupilot nor PX4 seems to be able to work with my quadrotor because of errors like “NO BARO SENSOR 0” or “Check BRD_TYPE: Baro: unable to initialise driver” or “warning: primary barometer not operational”. I’ve tried the latest stable version of PX4 (1.6.5) along with 1.6.3, 1.6.0, and 1.5.5. The same errors occurred in each version except 1.5.5,which caused the pixhawk to not respond and be unable to boot.

I have been using both Mission Planner and QGroundControl. I am using a pixhawk 2.4.8 that is very new and has never been flown.

Do I have a defective pixhawk? Do I have to modify any of the internal setting like the CAL_BARO_PRIME setting which is defaulted to 0?

Which hardware do you have? I would flash latest stable PX4, reset all params, and try again. From there we can investigate if the baro is being detected

How do you flash the latest stable PX4?

Flash through QGroundControl.

Reinstalled latest stable PX4, reset everything, getting error: “NO BARO SENSOR 0”

Which board is this?
If you connect the system console (https://dev.px4.io/en/debug/system_console.html) you can watch the bootup and see what happens. You can also try manually starting the baro driver to see if it makes a difference.
It’s sounding like a hardware problem, but personally I’d still poke around to try and verify.