git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13354 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2020-02-12 15:15:49 +00:00
parent 44b7d29577
commit d438ad9831
6 changed files with 98 additions and 55 deletions

View File

@ -66,12 +66,12 @@ endif
# Enables the use of FPU (no, softfp, hard). # Enables the use of FPU (no, softfp, hard).
ifeq ($(USE_FPU),) ifeq ($(USE_FPU),)
USE_FPU = no USE_FPU = hard
endif endif
# FPU-related options. # FPU-related options.
ifeq ($(USE_FPU_OPT),) ifeq ($(USE_FPU_OPT),)
USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv5-d16 USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv5-sp-d16 -fsingle-precision-constant
endif endif
# #
@ -112,6 +112,7 @@ include $(CHIBIOS)/tools/mk/autobuild.mk
include $(CHIBIOS)/test/lib/test.mk include $(CHIBIOS)/test/lib/test.mk
include $(CHIBIOS)/test/rt/rt_test.mk include $(CHIBIOS)/test/rt/rt_test.mk
include $(CHIBIOS)/test/oslib/oslib_test.mk include $(CHIBIOS)/test/oslib/oslib_test.mk
include $(CHIBIOS)/os/hal/lib/streams/streams.mk
# Define linker script file here # Define linker script file here
LDSCRIPT= $(STARTUPLD)/STM32H755xI_M7.ld LDSCRIPT= $(STARTUPLD)/STM32H755xI_M7.ld
@ -150,7 +151,7 @@ CPPWARN = -Wall -Wextra -Wundef
# #
# List all user C define here, like -D_DEBUG=1 # List all user C define here, like -D_DEBUG=1
UDEFS = -DCORE_CM7 UDEFS = -DCORE_CM7 -DCHPRINTF_USE_FLOAT=1
# Define ASM defines here # Define ASM defines here
UADEFS = UADEFS =

View File

@ -19,6 +19,8 @@
#include "rt_test_root.h" #include "rt_test_root.h"
#include "oslib_test_root.h" #include "oslib_test_root.h"
#include "chprintf.h"
/* /*
* This is a periodic thread that does absolutely nothing except flashing * This is a periodic thread that does absolutely nothing except flashing
* a LED. * a LED.
@ -44,9 +46,12 @@ static THD_FUNCTION(Thread1, arg) {
} }
} }
#include "i_ctrl.h"
/* /*
* Application entry point. * Application entry point.
*/ */
__attribute__((section(".ram6_init.main")))
int main(void) { int main(void) {
/* /*
@ -64,6 +69,37 @@ int main(void) {
*/ */
sdStart(&SD3, NULL); sdStart(&SD3, NULL);
time_measurement_t tm1;
chTMObjectInit(&tm1);
float32_t vbridge[N_PHASES];
for (int i = 0; i < 10; i++) {
chTMStartMeasurementX(&tm1);
{
static float32_t duty[N_PHASES] = {0.0f};
float32_t il[N_PHASES] = {1.0f, 5.0f, 3.0f};
float32_t vc[N_PHASES] = {300.0f, 400.0f, 100.0f};
float32_t vDC[DC_RAILS] = {450.0f, 400.0f};
float32_t iL_ref[N_PHASES] = {7.0f, 10.0f, 5.0f};
bool enable = 1;
ictrl_3L_step(il, vc, vDC, iL_ref, enable, vbridge);
calculate_duty_cycle(vbridge, vDC, duty);
}
chTMStopMeasurementX(&tm1);
}
chprintf((BaseSequentialStream *)&SD3, "Measurements: %d\r\n", tm1.n);
chprintf((BaseSequentialStream *)&SD3, "Best measurement: %d\r\n", tm1.best);
chprintf((BaseSequentialStream *)&SD3, "Worst measurement: %d\r\n", tm1.worst);
chprintf((BaseSequentialStream *)&SD3, "Last measurement: %d\r\n", tm1.last);
chprintf((BaseSequentialStream *)&SD3, "vbridge[0]: %f\r\n", vbridge[0]);
chprintf((BaseSequentialStream *)&SD3, "vbridge[1]: %f\r\n", vbridge[1]);
chprintf((BaseSequentialStream *)&SD3, "vbridge[2]: %f\r\n", vbridge[2]);
/* /*
* Creates the example thread. * Creates the example thread.
*/ */

View File

@ -68,6 +68,7 @@ static void adc_lld_stop_adc(ADC_TypeDef *adc) {
adc->CR |= ADC_CR_ADSTP; adc->CR |= ADC_CR_ADSTP;
while (adc->CR & ADC_CR_ADSTP) while (adc->CR & ADC_CR_ADSTP)
; ;
adcp->adc->IER = 0;
} }
} }

View File

@ -258,6 +258,7 @@ static void adc_lld_stop_adc(ADCDriver *adcp) {
adcp->adcm->CR |= ADC_CR_ADSTP; adcp->adcm->CR |= ADC_CR_ADSTP;
while (adcp->adcm->CR & ADC_CR_ADSTP) while (adcp->adcm->CR & ADC_CR_ADSTP)
; ;
adcp->adcm->IER = 0;
} }
} }

View File

@ -154,6 +154,10 @@
- HAL: Added a new interface for range-finder devices (used by EX). - HAL: Added a new interface for range-finder devices (used by EX).
- HAL: Added mcuconf.h updater tool for STM32F407 (backported to 19.1.1). - HAL: Added mcuconf.h updater tool for STM32F407 (backported to 19.1.1).
- NIL: Integrated NIL 4.0. - NIL: Integrated NIL 4.0.
- FIX: Fixed missing IRQ disabling in ADCv1 and ADCv3 STM32 drivers (bug #1073)
(backported to 19.1.4)(backported to 18.2.3).
- FIX: Fixed missing parenthesis in ADC _adc_isr_error_code macro (bug #1072)
(backported to 19.1.4)(backported to 18.2.3).
- FIX: Fixed invalid macro check in test library (bug #1071) - FIX: Fixed invalid macro check in test library (bug #1071)
(backported to 19.1.4). (backported to 19.1.4).
- FIX: Fixed non-standard declaration in STM32 ADCv3 driver (bug #1070) - FIX: Fixed non-standard declaration in STM32 ADCv3 driver (bug #1070)