Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example_i2s: interrupt service routine never runs #423

Open
grinningmosfet opened this issue Oct 29, 2023 · 1 comment
Open

example_i2s: interrupt service routine never runs #423

grinningmosfet opened this issue Oct 29, 2023 · 1 comment
Assignees

Comments

@grinningmosfet
Copy link
Contributor

grinningmosfet commented Oct 29, 2023

Summary

In the example_i2s example, the interrupt service routine should set a flag to print irq 1 on the serial output via the PRINTF macro when the internal I2S FIFO's watermark is reached:

void handler_irq_i2s(uint32_t id) {
    i2s_interrupt_flag = 1;
}

...

int main(int argc, char *argv[]) {

...

  if (i2s_interrupt_flag) {
      PRINTF("irq 1\r\n\r");
      i2s_interrupt_flag = 0;
  }

...

}

But it does not. The interrupt does not seem to be handled.

Steps to reproduce

Run the example_i2s example according to the docs.

  • Clone the X-HEEP repository
  • Open a shell in the x-heep directory and issue the following commands:
  • conda activate core-v-mini-mcu
  • make mcu-gen
  • Edit x-heep/sw/applications/example_i2s/main.c by replacing the line #define PRINTF_IN_SIM 0 by #define PRINTF_IN_SIM 1
  • make app PROJECT=example_i2s
  • make verilator-sim
  • cd ./build/openhwgroup.org_systems_core-v-mini-mcu_0/sim-verilator
  • ./Vtestharness +firmware=../../../sw/build/main.hex
  • cat uart0.log

Expected behaviour

Finding some irq 1s into the uart0.log logs file.

Actual behaviour

uart0.log logs the following:

I2S DEMO
 Valid:  0
 Load:   0
 B0
 0x8765431 0xfedcba9
 0x8765431 0xfedcba9
 B1
 0x8765431 0xfedcba9
 0x8765431 0xfedcba9
 B2
 0x8765431 0xfedcba9
 0x8765431 0xfedcba9
 B3
 0x8765431 0xfedcba9
 0x8765431 0xfedcba9
 Success.

The program exit value is 0. There is not a single standalone irq 1 printed.

@grinningmosfet
Copy link
Contributor Author

The function's declaration actually called is that implemented in x-heep/sw/device/lib/drivers/i2s/i2s.c. Removing it fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants