MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / main

Function main

test/common/unit_test_client.cpp:112–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110#endif
111
112int main(void)
113{
114 int fake_argc = 1;
115 const auto fake_arg0 = "dummy";
116 char *fake_argv0 = const_cast<char *>(fake_arg0);
117 char **fake_argv = &fake_argv0;
118 ::testing::InitGoogleTest(&fake_argc, fake_argv);
119
120 ::testing::TestEventListeners &listeners = ::testing::UnitTest::GetInstance()->listeners();
121 listeners.Append(new LeakChecker);
122
123#if (defined(RPMSG) || defined(UART) || defined(MU))
124 delete listeners.Release(listeners.default_result_printer());
125 listeners.Append(new MinimalistPrinter);
126#ifdef UNITY_DUMP_RESULTS
127 listeners.Append(new CornTestingFrameworkPrint());
128#endif
129
130 /* Initialize GIC */
131 BOARD_InitHardware();
132
133#ifdef CORE1_IMAGE_COPY_TO_RAM
134 /* Calculate size of the image */
135 uint32_t core1_image_size;
136 core1_image_size = get_core1_image_size();
137 PRINTF("Copy CORE1 image to address: 0x%x, size: %d\r\n", (void *)(char *)CORE1_BOOT_ADDRESS, core1_image_size);
138
139 /* Copy application from FLASH to RAM */
140 memcpy((void *)(char *)CORE1_BOOT_ADDRESS, (void *)CORE1_IMAGE_START, core1_image_size);
141
142#ifdef APP_INVALIDATE_CACHE_FOR_SECONDARY_CORE_IMAGE_MEMORY
143 invalidate_cache_for_core1_image_memory(CORE1_BOOT_ADDRESS, core1_image_size);
144#endif /* APP_INVALIDATE_CACHE_FOR_SECONDARY_CORE_IMAGE_MEMORY */
145
146#endif
147
148#if defined(RPMSG)
149 env_init();
150#endif
151#endif
152
153#if defined(RPMSG)
154 /* Initialize MCMGR before calling its API */
155 MCMGR_Init();
156
157 /* Register the application event before starting the secondary core */
158 MCMGR_RegisterEvent(kMCMGR_RemoteApplicationEvent, eRPCReadyEventHandler, NULL);
159
160 /* Boot Secondary core application */
161 MCMGR_StartCore(kMCMGR_Core1, (void *)(char *)CORE1_BOOT_ADDRESS, (uint32_t)rpmsg_lite_base,
162 kMCMGR_Start_Synchronous);
163
164 /* Wait until the secondary core application signals the rpmsg remote has been initialized and is ready to
165 * communicate. */
166 while (APP_ERPC_READY_EVENT_DATA != eRPCReadyEventData)
167 {
168 };
169#elif defined(MU)

Callers

nothing calls this directly

Calls 14

InitGoogleTestFunction · 0.85
erpc_mbf_rpmsg_initFunction · 0.85
erpc_mbf_dynamic_initFunction · 0.85
erpc_transport_mu_initFunction · 0.85
erpc_client_initFunction · 0.85
RUN_ALL_TESTSFunction · 0.85
erpc_client_deinitFunction · 0.85
AppendMethod · 0.80
ReleaseMethod · 0.80
initInterfaces_commonFunction · 0.70

Tested by

no test coverage detected