README.rst
1.. zephyr:code-sample:: ipm-mhu-dual-core
2 :name: IPM with ARM MHU
3 :relevant-api: ipm_interface
4
5 Implement inter-processor mailbox (IPM) using an MHU (Message Handling Unit)
6
7Overview
8********
9An MHU (Message Handling Unit) enables software to raise interrupts to
10the processor cores. This sample is a simple dual-core example for a
11Musca A1 board that has two MHU units. This sample only test MHU0, the
12steps are:
13
141. CPU 0 will wake up CPU 1 after initialization
152. CPU 1 will send to CPU 0 an interrupt over MHU0
163. CPU 0 return the same to CPU 1 when received MHU0 interrupt
174. Test done when CPU 1 received MHU0 interrupt
18
19Building and Running
20********************
21
22On Musca B1
23-----------
24
25This project outputs 'IPM MHU sample on musca_b1' to the console.
26It can be built and executed on Musca B1 CPU 0 as follows:
27
28.. zephyr-app-commands::
29 :zephyr-app: samples/drivers/ipm/ipm_mhu_dual_core
30 :board: v2m_musca_b1
31 :goals: run
32 :compact:
33
34This project outputs 'IPM MHU sample on v2m_musca_b1_ns' to the console.
35It can be built and executed on Musca B1 CPU 1 as follows:
36
37.. zephyr-app-commands::
38 :zephyr-app: samples/drivers/ipm/ipm_mhu_dual_core
39 :board: v2m_musca_b1_ns
40 :goals: run
41 :compact:
42
43Combine images for Musca
44========================
45
46A third-party tool (srecord) is used to generate the Intel formatted hex image.
47For more information refer to the `Srecord Manual`_.
48
49.. code-block:: bash
50
51 srec_cat zephyr.bin -Binary -offset $IMAGE_OFFSET zephyr_nonsecure.bin -Binary -offset $IMAGE_NS_OFFSET -o dual_core_zephyr.hex -Intel
52
53 # This command is an example for Musca B1
54 srec_cat zephyr.bin -Binary -offset 0xA000000 zephyr_nonsecure.bin -Binary -offset 0xA060400 -o dual_core_zephyr.hex -Intel
55
56Open a serial terminal (minicom, putty, etc.) and connect the board with the
57following settings:
58
59- Speed: 115200
60- Data: 8 bits
61- Parity: None
62- Stop bits: 1
63
64Reset the board and the following message will appear on the corresponding
65serial port.
66
67Sample Output
68=============
69
70.. code-block:: console
71
72 ***** Booting Zephyr OS zephyr-v1.13.0-3378-g3625524 *****
73 IPM MHU sample on musca_a
74 CPU 0, get MHU0 success!
75 ***** Booting Zephyr OS zephyr-v1.13.0-3378-g3625524 *****
76 IPM MHU sample on musca_a_nonsecure
77 CPU 1, get MHU0 success!
78 MHU ISR on CPU 0
79 MHU ISR on CPU 1
80 MHU Test Done.
81
82
83.. _Srecord Manual:
84 https://srecord.sourceforge.net/man/man1/srec_cat.1.html
85