- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I am making some programs for beginners using Modus ToolBox 2.1. When migrating the development environment from PSoc Creator to Modus, I had a hard time creating a simple program.
Here, a simple program for the M4 core of PSoC 6 using Modus Toolbox2.1 is introduced here.
The environment is as follows.
Last time, I used UART by setting SCB with the Device Configuration tool, but there is a library that can use the printf() function more easily. It's also used in the "Hello World" example, but here's an extract of only the UART output settings using printf () with Retarget IO Library.
Select the CY8CKIT-062-BLE kit from the New Application tool in the Quick Panel and use it based on what was created in the empty PSoC 6 app.
The Device Configuration tool in the IDE of Modus Toolbox2.1 is not used for Pin and UART related component settings.
Launch the Library Manager from the Quick Panel to add the Retarget IO Lib to your project as follows.
Go to the “Libraries” tab in the Library Manager and check retarget-io.
After checking, click the “Apply” button at the bottom right to close the Library Manager.
Then all you have to do is write the program.
The program is as follows.
#include "cy_pdl.h"
#include "cyhal.h"
#include "cybsp.h"
#include "cy_retarget_io.h"
int main(void)
{
cy_rslt_t result;
/* Initialize the device and board peripherals */
result = cybsp_init() ;
if (result != CY_RSLT_SUCCESS)
{
CY_ASSERT(0);
}
result = cy_retarget_io_init(CYBSP_DEBUG_UART_TX, CYBSP_DEBUG_UART_RX, CY_RETARGET_IO_BAUDRATE);
if (result != CY_RSLT_SUCCESS)
{
CY_ASSERT(0);
}
__enable_irq();
/* \x1b[2J\x1b[;H - ANSI ESC sequence for clear screen */
printf("\x1b[2J\x1b[;H");
printf("PSoC 6 MCU: Hello World! Example \r\n\n");
for (;;)
{
}
}
Since I used TeraTerm as a terminal, the setting is described below.
Note: “Port” is depending on the PC environment.
It's very easy. Please use it for debugging in the Modus Toolbox environment.
Thanks,
- Labels:
-
PSoC 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Kenshow-san,
Thank you very much for your sharing this CE.
Best regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone,
The program was changed more simply.
I deleted an unnecessary object call declaration.
Thanks,
Kenshow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I changed the order in which API functions are called and updated the program.
Thanks,
Kenshow
18-June-2020