Add files to eliminate HAL dependency, build/compile pass
Signed-off-by: Bohdan Kovalchuk <bohd@cypress.com>
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@cypress.com>
diff --git a/boot/cypress/MCUBootApp/main.c b/boot/cypress/MCUBootApp/main.c
index 47f494a..e908d07 100644
--- a/boot/cypress/MCUBootApp/main.c
+++ b/boot/cypress/MCUBootApp/main.c
@@ -17,11 +17,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
-
/* Cypress pdl headers */
#include "cy_pdl.h"
-#include "cyhal.h"
-#include "cy_retarget_io.h"
+#include "cy_retarget_io_pdl.h"
#include "cy_result.h"
#include "sysflash/sysflash.h"
@@ -34,9 +32,9 @@
#include "bootutil/bootutil_log.h"
/* Define pins for UART debug output */
-
-#define CY_DEBUG_UART_TX (P5_1)
-#define CY_DEBUG_UART_RX (P5_0)
+#define CYBSP_UART_ENABLED 1U
+#define CYBSP_UART_HW SCB5
+#define CYBSP_UART_IRQ scb_5_interrupt_IRQn
static void do_boot(struct boot_rsp *rsp)
{
@@ -47,8 +45,6 @@
BOOT_LOG_INF("Starting User Application on CM4 (wait)...");
Cy_SysLib_Delay(100);
- cy_retarget_io_deinit();
-
Cy_SysEnableCM4(app_addr);
while (1)
@@ -59,14 +55,16 @@
int main(void)
{
- cy_rslt_t rc = !CY_RSLT_SUCCESS;
struct boot_rsp rsp ;
+ init_cycfg_clocks();
+ init_cycfg_peripherals();
+ init_cycfg_pins();
/* enable interrupts */
__enable_irq();
- /* Initialize retarget-io to use the debug UART port */
- cy_retarget_io_init(CY_DEBUG_UART_TX, CY_DEBUG_UART_RX, CY_RETARGET_IO_BAUDRATE);
+ /* Initialize retarget-io to use the debug UART port (CYBSP_UART_HW) */
+ cy_retarget_io_pdl_init(115200u);
BOOT_LOG_INF("MCUBoot Bootloader Started");