Hardware
RZ/A2M-Evaluation-Kit
Software
RZ/A2M Simple Applications Package V8.40
e2 studio V2022-01
GNU Arm Embedded Toolchain 9-2020-q2-update
Issue
Consult linker_script.ld from rza2m_fw_update_sample_freertos_gcc then modify this file in rza2m_blinky_sample_freertos_gcc.
Build rza2m_blinky_sample_freertos_gcc.bin.
Use image-gen.py from rza2m_fw_update_sample_freertos_gcc to generate userprog.rsu.
Programming userprog.rsu by rza2m_fw_update_sample_freertos_gcc through UART.
Power off and on the RZ/A2M-Evaluation-Kit, the program is running well that can see prompt in UART and LED is blinky.
Consult linker_script.ld from rza2m_fw_update_sample_freertos_gcc then modify this file in rza2m_usbh_msc_sample_freertos_gcc.
Build rza2m_usbh_msc_sample_freertos_gcc.bin.
Power off and on the RZ/A2M-Evaluation-Kit, program is not running well that only see partial prompt in UART and USB isn't work.
After adding debug message in program (rza2m_fw_update_sample_freertos_gcc), found the program is stock at function usbh0_hstd_ehci_init() because USB00.USBSTS.BIT.PeriodicScheduleStatus=0.
But USB00.USBSTS.BIT.PeriodicScheduleStatus=1 in the original version.
rza2m_usbh_msc_sample_freertos_gcc/generate/sc_drivers/r_usbh0/basic/src/r_usbh0_hehci_main.c
uint32_t usbh0_hstd_ehci_init(void)
{
...
addr = usbh0_hstd_ehci_get_periodic_frame_list_addr();
R_MMU_VAtoPA(addr,&USB00.PERIODICLISTBASE.LONG);
/* Enable Periodic Schedule */
USB00.USBCMD.BIT.PeriodicScheduleEnable = 1;
timeout = 0;
while (0 == USB00.USBSTS.BIT.PeriodicScheduleStatus)
if (timeout > USBH0_EHCI_TIMEOUT)
USBH0_HCI_PRINTF0_R("Error : usbh0_hstd_EhciInit TIMEOUT\n");
return USBH0_ERROR;
}
r_usbh0_hstd_hci_wait_time(1);
timeout++;
Attachments
rza2m_blinky_sample_freertos_gcc/linker_script.ld
rza2m_usbh_msc_sample_freertos_gcc/linker_script.ld
linker_script.zip
Could you change "r_startup_config.h" in "rza2m_fw_update_sample_freertos_gcc" and try?
Please change USB to USE as follows./* select whether USB0 use or not * 0 : Use USB0 * 1 : Not…
Please change USB to USE as follows./* select whether USB0 use or not * 0 : Use USB0 * 1 : Not use USB0 */#define STARTUP_CFG_DISABLE_USB0 (0)
/* select whether USB1 use or not * 0 : Use USB1 * 1 : Not use USB1 */ /* select whether USB1 use or not * 0 : Use USB1 * 1 : Not use USB1#define STARTUP_CFG_DISABLE_USB1 (0)