Microchip® Advanced Software Framework

sam_ba_monitor.c File Reference

Monitor functions for SAM-BA on SAM0 Port of rom monitor functions from legacy sam-ba software.

Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>
#include <string.h>
#include "sam_ba_monitor.h"
#include "usart_sam_ba.h"
#include "conf_board.h"

Data Structures

struct  t_monitor_if
 

Functions

void call_applet (uint32_t address)
 Execute an applet from the specified address. More...
 
void sam_ba_monitor_init (uint8_t com_interface)
 This function initializes the SAM-BA monitor. More...
 
void sam_ba_monitor_run (void)
 This function starts the SAM-BA monitor. More...
 
void sam_ba_putdata_term (uint8_t *data, uint32_t length)
 This function allows data rx by USART. More...
 

Variables

volatile bool b_terminal_mode = false
 
uint8_t command
 
uint32_t current_number
 
uint8_t data [SIZEBUFMAX]
 
uint32_t i
 
uint8_t j
 
uint32_t length
 
uint8_t * ptr
 
uint8_t * ptr_data
 
t_monitor_ifptr_monitor_if
 
const char RomBOOT_Version [] = SAM_BA_VERSION
 
volatile uint32_t sp
 
uint32_t u32tmp
 
const t_monitor_if uart_if
 

void call_applet ( uint32_t  address)

Execute an applet from the specified address.

Parameters
addressApplet address

References cpu_irq_disable(), and sp.

Referenced by sam_ba_monitor_run().

void sam_ba_monitor_init ( uint8_t  com_interface)

This function initializes the SAM-BA monitor.

Initialize the monitor.

Parameters
com_interfaceCommunication interface to be used.

References SAM_BA_INTERFACE_USART, and SAM_BA_INTERFACE_USBCDC.

Referenced by main().

void sam_ba_monitor_run ( void  )
void sam_ba_putdata_term ( uint8_t *  data,
uint32_t  length 
)

This function allows data rx by USART.

Parameters
*dataData pointer
lengthLength of the data

References b_terminal_mode, i, and t_monitor_if::putdata.

Referenced by sam_ba_monitor_run().

volatile bool b_terminal_mode = false
uint8_t command
uint32_t current_number

Referenced by sam_ba_monitor_run().

uint8_t data[SIZEBUFMAX]
uint32_t i

Referenced by _adc_get_inst_index(), _adc_set_config(), _eeprom_emulator_check_logical_page(), _extint_disable(), _extint_enable(), _json_parse(), _rtc_calendar_set_config(), _rtc_count_set_config(), _rww_eeprom_emulator_check_logical_page(), _rww_eeprom_emulator_move_data_to_spare(), _rww_eeprom_emulator_page_checksum(), _sercom_get_sercom_inst_index(), _sercom_set_handler(), _system_extint_init(), _tc_get_inst_index(), _tcc_build_ctrla(), _tcc_build_drvctrl(), _tcc_build_faults(), _tcc_get_inst_index(), _tcc_interrupt_handler(), _usb_device_interrupt_handler(), about_task(), ac_disable_events(), ac_enable_events(), ac_get_config_defaults(), ac_init(), adc_init(), aes_read_output_data(), aes_write_init_vector(), aes_write_input_data(), aes_write_key(), AESEncode(), APP_CommandsInit(), APP_CommandsPending(), APP_TaskHandler(), appCmdBuffer(), appCmdCheckPendingTable(), appDataInd(), appUartSendMessage(), arch_ioport_disable_port(), arch_ioport_enable_port(), at30tse_eeprom_write(), atcah_decrypt(), atcah_hmac(), atcah_io_decrypt(), atcah_privwrite_auth_mac(), atcah_secureboot_enc(), atcah_write_auth_mac(), base64decode(), ble_gatt_service_read(), ble_init(), ble_pair_passkey_enter(), ble_pair_passkey_erase_digits(), ble_pair_request_handler(), ble_scan_duplication_check(), ble_slave_security_request_handler(), bufchar(), calc_chksum_8bit(), calculate_crc(), cert_appdata_callback(), cert_handle_cert_rx_data(), cert_select_band(), check_usart_buffer(), CL_hashFinal(), CL_hashUpdate(), cleanup_adc_callback_mode_test(), cleanup_buffer_polled_write_interrupt_read_test(), convert_phyTransmitPower_to_reg_value(), create_name(), CreateAllRegSoftwareTimers(), dac_chan_write_buffer_wait(), dac_init(), decodeLength(), decodePacket(), deliverMessage(), demo_handle_evt_rx_data(), demoTimerCb(), dev_eui_read(), dir_next(), dir_remove(), disk_initialize(), disk_read(), disk_write(), displayRunDemoApp(), DutyCycleCallback(), Enableallchannels(), EnableChannels2(), encrypt_pldmic(), enddevice_cpc_execute_command(), extint_disable_events(), extint_enable_events(), extint_is_syncing(), f_getfree(), get_fileinfo(), get_token_value(), getChBandDrT1(), getChBandDrT2(), getSubBandId(), gfx_mono_draw_char_hugemem(), gfx_mono_draw_char_progmem(), gfx_mono_generic_draw_line(), gfx_mono_generic_put_bitmap(), gfx_mono_spinctrl_spincollection_add_spinner(), gfx_mono_spinctrl_spincollection_process_key(), gfx_mono_spinctrl_spincollection_show(), handle_input_message(), hid_keyboard_app_init(), hid_mouse_app_init(), hid_serv_init(), HMAC_Vector(), http_client_send_request(), http_client_socket_resolve_handler(), i2c_slave_read_packet_wait(), i2c_slave_write_packet_wait(), InitDefault433Channels(), InitDefault865Channels(), InitDefault868Channels(), InitDefault920Channels(), InitDefault920ChannelsKR(), InitDefault923Channels(), iso7816_cold_reset(), iso7816_data_block_atr(), iso7816_decode_atr(), iso7816_warm_reset(), LBTChannelPauseCallback(), led_toggle_indication(), LORAREG_GetAttr_DutyCycleTimer(), LORAREG_GetAttr_minLBTChPauseTimer(), LORAREG_Init(), m2m_memcmp(), main(), main_count_states(), main_extra_string(), main_init_buffers(), main_reset_states(), main_task(), main_test_memory(), MemcalcCrc(), memcpy_ascii_order(), memcpy_ascii_reorder(), memcpy_nibble_reorder(), memcpy_reorder(), memp_init(), menu_draw(), messageGetIdByGroupAddr(), messageReceiveProcess(), mmc_cmd8(), mote_demo_init(), MQTTClientInit(), MQTTSerialize_suback(), MQTTSerialize_subscribe(), MQTTSerialize_subscribeLength(), MQTTSerialize_unsubscribe(), MQTTSerialize_unsubscribeLength(), MQTTSubscribe(), nm_usart_protocol_handler(), nm_usart_send_regval(), nmi_inet_addr(), nvm_read_buffer(), nvm_update_buffer(), nvm_write_buffer(), NWK_Init(), NWK_LinearizeLqi(), nwkFrameAlloc(), nwkFrameInit(), nwkRxDuplicateRejectionTimerHandler(), nwkRxInit(), nwkRxRejectDuplicate(), parse_command(), pbuf_memcmp(), pbuf_memfind(), pds_nvm_write(), PHY_RandomReq(), PHY_SetIEEEAddr(), platform_create_hw_timer(), platform_send_sync(), print_array(), processRunRestoreBand(), putPacket(), RADIO_FrameRead(), RADIO_FrameWrite(), RADIO_ReadRandom(), rtc_calendar_disable_events(), rtc_calendar_enable_events(), rtc_calendar_get_config_defaults(), rtc_calendar_swap_time_mode(), rtc_count_disable_events(), rtc_count_enable_events(), rtc_count_get_config_defaults(), run_adc_callback_mode_test(), run_adc_polled_mode_test(), run_buffer_polled_write_interrupt_read_test(), run_eeprom_buffer_read_write_test(), run_eeprom_page_read_write_test(), run_fatfs_test(), run_i2c_full_speed_test(), run_i2c_master_transfer_test(), run_nvm_read_and_write_test(), run_nvm_update_test(), run_rww_eeprom_buffer_read_write_test(), run_rww_eeprom_page_read_write_test(), run_transceive_buffer_test(), run_trng_polling_read_test(), rw_test(), SAL_AESCmac(), sal_FillSubKey(), sal_GenerateSubkey(), sam_ba_monitor_run(), sam_ba_putdata_term(), scan_files(), SearchAvailableChannel1(), SearchAvailableChannel2(), setChlistDefaultState(), setDutyCycleTimer(), setEnableAllChs(), setJoinSuccess(), setLBTTimer(), setNewChannel(), setNewChannelsT1(), setup_adc_callback_mode_test(), setup_board(), setup_eeprom_buffer_read_write_test(), setup_eeprom_page_read_write_test(), setup_rww_eeprom_buffer_read_write_test(), setup_rww_eeprom_page_read_write_test(), sleepmgr_init(), spi_flash_erase(), spi_init(), spi_read_buffer_wait(), spi_transceive_buffer_wait(), spi_write_buffer_wait(), srecProtocol(), stb_ccm_secure(), StopAllRegSoftwareTimers(), sw_sha256_final(), sw_sha256_init(), sw_sha256_process(), system_pinmux_group_set_config(), tal_dump_registers(), tal_generate_rand_seed(), tal_init(), tal_pib_set(), tc_callback_to_change_duty_cycle(), tc_disable_events(), tc_enable_events(), tc_init(), tcc_callback_to_change_duty_cycle(), tcc_clear_status(), tcc_get_status(), tcc_init(), test_standby_mode_dynamic_power_sleepwalking(), test_suite_run(), tfa_continuous_tx_start(), tfa_get_batmon_voltage(), transmit_frame(), trng_init(), UartBytesReceived(), udc_req_std_dev_get_str_desc(), udi_hid_kbd_down(), udi_hid_kbd_up(), udi_msc_spc_inquiry(), uhc_connection_tree(), uhc_dev_get_string(), uhc_dev_reset(), uhc_enumeration_step14(), uhc_enumeration_step15(), uhc_enumeration_step18_lpm(), uhc_notify_sof(), uhi_cdc_free_device(), uhi_cdc_install(), uhi_vendor_install(), UpdateChannelIdStatusT2(), UpdateMinMaxChDataRate(), usart_init(), usart_putdata(), usart_read_buffer_wait(), usart_write_buffer_wait(), usb_init(), usr_range_test_beacon_rsp(), usr_range_test_beacon_tx(), usr_range_test_marker_ind(), ValidateChannelMaskT2(), ValidateSupportedDr(), WINC1500_read(), WINC1500_write(), write_all_tal_pib_to_trx(), and X509Cert_Dump().

uint32_t length

Referenced by _http_client_read_chuked_entity(), _http_client_request(), _spi_master_vec_int_handler(), _spi_read_buffer(), _spi_transceive_buffer(), _spi_write_buffer(), _usart_read_buffer(), _usart_write_buffer(), adp_interface_send(), at30tse_eeprom_read(), ble_pair_passkey_enter(), ble_pair_passkey_erase_digits(), BM_APPLICATION_ServerCreateService(), brd_adv_appearance(), brd_adv_comp_list_service_uuid128(), brd_adv_comp_list_service_uuid16(), brd_adv_comp_list_service_uuid32(), brd_adv_comp_local_name(), brd_adv_incomp_list_service_uuid128(), brd_adv_incomp_list_service_uuid16(), brd_adv_incomp_list_service_uuid32(), brd_adv_manufacturer_data(), brd_adv_shortened_local_name(), calc_chksum_8bit(), calculate_crc(), crc32_recalculate(), csc_serv_send_data(), dac_chan_write_buffer_job(), decodeLength(), dfu_program_memory_erase(), dfu_program_memory_read(), dfu_program_memory_write(), dfu_program_memory_write_continue(), eddystone_adv_start(), getbytes(), hid_boot_keyboardreport_update(), hid_boot_mousereport_update(), i2c_slave_read_packet_wait(), i2c_slave_write_packet_wait(), ieee11073_decode_metadata(), log_output(), MSG_Send(), nvm_read_buffer(), nvm_update_buffer(), nvm_write_buffer(), pbuf_alloc(), print_array(), sam_ba_monitor_run(), sio2host_tx(), spi_master_vec_transceive_buffer_job(), spi_transceive_buffer_wait(), spi_write_buffer_wait(), store_file_packet(), tal_dump_registers(), udi_msc_spc_inquiry(), udi_msc_spc_requestsense(), uhc_request_bos_desc(), usart_getdata_xmd(), usart_putdata(), and usart_putdata_xmd().

uint8_t * ptr_data
t_monitor_if* ptr_monitor_if
const char RomBOOT_Version[] = SAM_BA_VERSION

Referenced by sam_ba_monitor_run().

volatile uint32_t sp

Referenced by call_applet(), and sam_ba_monitor_run().

uint32_t u32tmp

Referenced by sam_ba_monitor_run().

const t_monitor_if uart_if
Initial value:
=
uint32_t usart_putdata(void const *data, uint32_t length)
Send given data (polling)
Definition: usart_sam_ba.c:164
int usart_getc(void)
Waits and gets a value on usart line.
Definition: usart_sam_ba.c:133
uint32_t usart_getdata(void *data, uint32_t length)
Get data from com device.
Definition: usart_sam_ba.c:178
uint32_t usart_getdata_xmd(void *data, uint32_t length)
Called when a transfer from host to target is being made (considered an download).
Definition: usart_sam_ba.c:370
int usart_putc(int value)
Puts a byte on usart line The type int is used to support printf redirection from compiler LIB...
Definition: usart_sam_ba.c:125
uint32_t usart_putdata_xmd(void const *data, uint32_t length)
Called when a transfer from target to host is being made(considered an upload).
Definition: usart_sam_ba.c:290
bool usart_is_rx_ready(void)
This function checks if a character has been received on the usart line.
Definition: usart_sam_ba.c:150