Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
Our project uses WICED SDK 3.1.2 and the Inventek board ISM43362_M3G_L44(The BCM943362WCD4 and ISM43362_M3G_L44 modules are identical modules. Both uses the STM32F205 as host MCU and same BCM43362 WiFi radio). We want to use ADC 3 [WICED_GPIO_4}/GPIOA3 pin for factory reset button. wiced_adc_init() always fails in main() of WICED-SDK\apps\waf\bootloader. But wiced_adc_init() is ok in void application_start( ). Is there any configuration missing for wiced_adc_init() in bootloader main()?
We are trying to use the ADC 3 [WICED_GPIO_4}/GPIOA3 pin for factory reset button. Below is the code implementation in platform_check_factory_reset( void )
#define KEYADC WICED_ADC_3
/* Checks if a factory reset is requested */
wiced_bool_t platform_check_factory_reset( void )
uint16_t key_value = 0;
if( (key_value) >= (2033) )
/* Factory reset button is being pressed. */
When I press the factory_reset button, the key_value above should be >=2033, but its value always 31~40. The platform_check_factory_reset() always return WICED_FALSE. But I put those statement above in the
void application_start( ), it works perfectly. We need the urgent help to resolve the issue.
In addition, how to debug the bootloader code? is there a minimal example of implementing a simple getchar() / putchar() in the bootloader? Can I make target "snip.hello_feng-ISM43362_M3G_L44-debug download" and set the breakpoints in platform_check_factory_reset()?
I didn't dig deep in to this, but the short answer is, the boot loader isn't meant to have any of these. Boot loaders are designed to do minimum functionality of booting an application. Trying to enable ADC and UART communication (which are not by default) means increase the size of the boot loader (over the limited size given to it) and wasn't supported.
Is there a particular reason you want to USE ADC rather than the GPIO just for the booting? Also using ADC for factory reset sounds dangerous to me.
We don't have a specific gpio pin for the factory reset button on our board. So we try to use a gpio pin for ADC function. In this way we may have three buttons(that correspond to high/medium/low sampling voltage level) on the one adc pin.
How to debug the bootloader code? is there a minimal example of implementing a simple getchar() / putchar() in the bootloader? Can I make target "snip.hello_feng-ISM43362_M3G_L44-debug download" and set the breakpoints in platform_check_factory_reset()?
I don't assume you need the three buttons in the boot loader. So why not configure it as GPIO in the plaform_check_factory_reset (as this is called only from the boot loader) and when application start configure it as a ADC to correspond to 3 buttons.
Debugging the boot loader is exactly the same as debugging and application. The boot loader is produced in a different folder usually called build/waf_bootloader-NoOS-NoNS-XXX where XXX is your platform. The elf file is in the binary folder, set your debugger to this elf file and you should be able to debug it as normal.
Regarding putchar and getchar, you will notice that in platform_init_external_devices the platform_stdio_init (which enables UART) is wrapped in the a #ifndef WICEC_DISABLE_STDIO this flag is enabled for boot loader, so boot loader doesn't support printing to UART by default.
As you notice we are making the boot loader as minimal as possible, so try to keep its job just for boot loading.