cancel
Showing results for 
Search instead for 
Did you mean: 

The project generated by MCSDK 6.4.1 compile with errors?

Junde
Senior III

Hi there,

I generate a project using MCSDK 6.4.1 without any errors. (Find the project file in attachments)

However, when I compile my MDK project, it shows some errors as follows:

Junde_0-1763533795815.png

The details about the definition:

```c

#define VBUS_PARTITIONING_FACTOR 10.989010989010989 /*!< It expresses how
                                                                                                        much the Vbus is attenuated
                                                                                                        before being converted into
                                                                                                        digital value */
#define NOMINAL_BUS_VOLTAGE_V 24U

#define ADC_REFERENCE_VOLTAGE 3.3

```

Why did these errors happen? Does that mean there are some errors in my MCSDK project file?

1 REPLY 1
STuser2
Senior III

The VBUS_PARTITIONING_FACTOR can never be greater than 1 it is R2/(R2 + R1) 

#define UNDERVOLTAGE_THRESHOLD_d (uint16_t)((UD_VOLTAGE_THRESHOLD_V * 65535) /\

((uint16_t)(ADC_REFERENCE_VOLTAGE / VBUS_PARTITIONING_FACTOR)))

 

ADC_REFERENCE_VOLTAGE / VBUS_PARTITIONING_FACTOR) = 3.3 / 10.9 which will be 0

#define UNDERVOLTAGE_THRESHOLD_d (Undervoltage Value) / 0 for which it is showing error.

You have to ensure that the VBUS_PARTITIONING_FACTOR is correct.

STuser2_0-1763535615278.png

If you verify the B-G431B-ESC1 schematic the voltage divider will be

18/(18+ 169) = 0.096