Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
HarisGusic
Level 1
Level 1
First question asked Welcome!

Edit: I have resolved the issue. I had to go to to "Project -> Manage -> Select Software Packs..." and enable ARM_Compiler. After that, I had to go to "Run-Time Environment" and set "Compiler->I/O->STDOUT" to ITM.

Hi,

I am trying to get UART communication working using the PDL version 2.1.0.

I have attached a simple program. The program is a slightly modified version of the one provided in the official example for using the PDL library on an S6E2GM device. I will attach that program as well. I have taken care to include and add all files that were used in the example project.

When I download the program, the output pin P1B should get initialized to HIGH, and I should continuously be getting the message "Hello\n" on my serial connection. Instead, nothing happens.

If I run the debugger and press Run, the program pauses at a BKPT instruction as shown below. I would then have to press Run 2 more times for the program to run and keep running without any further pauses. Then I connect a serial terminal (Termite) and I continuously receive the text "Hello" in it, as expected. Also, it seems that the breakpoints happen before the program enters the main function.

 

 

 

0x00001CDC BEAB      BKPT          0xAB

 

 

 

If I remove printf and replace it with fputc('a', NULL) provided by the PDL, I get the behavior that is expected from such modified program.

What could be causing this?

main.c:

 

 

 

#include "pdl_header.h"

int main(void)
{   
    Uart_Io_Init();
    Gpio1pin_InitOut(GPIO1PIN_P1B, Gpio1pin_InitVal(1u));
    
    printf("Hello\n");
    while(1) {}
}

 

 

 

 

 

 main.c from the official example:

 

 

 

 

#include "pdl_header.h"

int main(void)
{   
    Uart_Io_Init();/* Initializatio of the UART unit and GPIO used in the communication */
  
    printf("Welcome to use Cypress PDL 2.1!\n");
    
    while(1)
    {
         /* Data is normally sent and received */        
    }
}

 

 

 

0 Likes
1 Solution
Roy_Liu
Moderator
Moderator
Moderator
First comment on KBA 10 questions asked First comment on blog

Thank you very much for sharing the resolution, let me post it again to benefit the others who may come across this issue.

 I have resolved the issue. I had to go to "Project -> Manage -> Select Software Packs..." and enable ARM_Compiler. After that, I had to go to "Run-Time Environment" and set "Compiler->I/O->STDOUT" to ITM.

 

Roy Liu

View solution in original post

0 Likes
1 Reply
Roy_Liu
Moderator
Moderator
Moderator
First comment on KBA 10 questions asked First comment on blog

Thank you very much for sharing the resolution, let me post it again to benefit the others who may come across this issue.

 I have resolved the issue. I had to go to "Project -> Manage -> Select Software Packs..." and enable ARM_Compiler. After that, I had to go to "Run-Time Environment" and set "Compiler->I/O->STDOUT" to ITM.

 

Roy Liu
0 Likes