public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ba Gia Bao Phan <phanbagiabao2001@gmail.com>
To: devel@edk2.groups.io
Subject: [edk2-devel] Cannot access SerialPortPoll function
Date: Thu, 25 Apr 2024 08:57:52 +0200	[thread overview]
Message-ID: <CAK9R8u_MxuvnCodw6R6QQBBUxaoGMTS1ykdCjRW7HJobNQ4mAQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1642 bytes --]

Hello Everyone,

I'm working on a project with edk2, and these guys are trying to port edk2
to STM32MP25 platforms. I have a problem with the module SerialPortLib,
specifically the function *SerialPortPoll*. I made a test that adds a line
of debug in this function and adds a MmioWrite8 to a forbidden address  of
my platform but I don't see anything. This demonstrates that I cannot
access this function (this function is not loaded). Do you know why and how
to solve this?

Here is my function SerialPortPoll
BOOLEAN
EFIAPI
SerialPortPoll (
  VOID
  )
{
  DEBUG ((DEBUG_INFO, "In SerialPortPollllllllllllllllllllllllllllllll\n"));
  MmioWrite8(0x80000000, 0xff);
  return FALSE;
}

And here is my function SerialPortWrite that works well because I can see
the boot log message
UINTN
EFIAPI
SerialPortWrite (
  IN UINT8     *Buffer,
  IN UINTN     NumberOfBytes
)
{
  UINT8 *CONST  Final = &Buffer[NumberOfBytes];
  while (Buffer < Final) {
    // Wait until UART able to accept another char
    while (!(MmioRead32 (USART2_BASE + R_UART_ISR) & (1<<7))) {
    }
    MmioWrite8 (USART2_BASE + R_UART_TDR, *Buffer++);
  }
  DEBUG ((DEBUG_INFO, "end SerialPortWriteeeeeeeeeeeeeeeee\n"));

  return NumberOfBytes;
}

Thanks
-- 
PHAN Ba Gia Bao
Etudiant en 5A STI - INSA Centre Val de Loire


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118302): https://edk2.groups.io/g/devel/message/118302
Mute This Topic: https://groups.io/mt/105739991/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 2551 bytes --]

                 reply	other threads:[~2024-04-25 22:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK9R8u_MxuvnCodw6R6QQBBUxaoGMTS1ykdCjRW7HJobNQ4mAQ@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox