Skip to content

Commit 5959b1f

Browse files
committed
7.4.0
1 parent 0fca845 commit 5959b1f

File tree

13 files changed

+94
-158
lines changed

13 files changed

+94
-158
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ This repository can be used in several ways:
2424
+---cmsis-packs <=== standalone examples
2525
| +---dpp_nucleo-c031c6-qk-gcc
2626
| +---dpp_nucleo-c031c6-qk-keil
27-
| \---dpp_nucleo-c031c6-qk-stm32cube
27+
| +---dpp_nucleo-c031c6-qk-stm32cube
28+
| \---dpp_nucleo-u545re-qk-stm32cube
2829
|
2930
```
3031

@@ -73,13 +74,16 @@ This repository can be used in several ways:
7374
+---emwin
7475
| +---demo_no_wm
7576
| \---demo_with_wm
77+
|
7678
+---freertos
7779
| \---arm-cm
7880
| +---dpp_ek-tm4c123gxl
7981
| \---dpp_nucleo-h743zi
82+
|
8083
+---lwip
8184
| \---arm-cm
8285
| \---lwip_ek-lm3s6965
86+
|
8387
+---msp430
8488
| +---blinky_msp-exp430f5529lp
8589
| +---blinky_msp-exp430g2
@@ -152,16 +156,18 @@ computer. The interfaces created by QView can visualize the data produced
152156
by [QP/Spy software tracing system](https://www.state-machine.com/qtools/qpspy.html)
153157
and can also interact with the embedded target by sending various commands.
154158

159+
> **NOTE** You need to **install** the `qview` package in your Python setup.<br>
160+
`pip install qview`
161+
155162
The python scripts `qview-dpp/dpp.py` and `qview-dpp/dpp1.py` will allow
156163
monitoring of all DPP examples running on any supported board (or on the
157164
host computer). Here is how you can launch the QView monitoring for DPP:
158165

159166
```
160-
python %QTOOLS%\qview\qview.py dpp.py
161-
```
167+
pythonw dpp.py
162168
163-
> **NOTE** You need the `qview.py` Python script, which in the command-line
164-
above is assumed to be located in `%QTOOLS%\qview`.
169+
pythonw dpp1.py
170+
```
165171

166172
The following screen shot shows QView for the DPP (Dining Philosophers Problem)
167173
application with the QSPY ouptut in the background.

arm-cm/dpp_nucleo-u545re/README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
> **NOTE**
22
This file is best viewed in a **markdown viewer**, such as the one built into GitHub. Markdown viewers are also available as plug-ins to popular Internet browsers.
33

4-
# DPP on NUCLEO-C031C6
5-
This example demonstrates the [Dining Philosophers Problem (DPP) application](https://www.state-machine.com/qpc/tut_dpp.html) on the STM32 NUCLEO-C031C6 board (ARM Cortex-M0+).
4+
# DPP on NUCLEO-U545RE
5+
This example demonstrates the [Dining Philosophers Problem (DPP) application](https://www.state-machine.com/qpc/tut_dpp.html) on the STM32 NUCLEO-U545RE board (ARM Cortex-__M33__).
66

77
<p align="center">
8-
<img src="./stm32-nucleo-c031c6.jpg"/><br>
9-
<b>STM32 NUCLEO-C031C6</b>
8+
<img src="./stm32-nucleo-u545re.jpg"/><br>
9+
<b>STM32 NUCLEO-U545RE</b>
1010
</p>
1111

1212
> **NOTE**
@@ -43,42 +43,42 @@ This example can be used as a starting point for any other ARM Cortex-M MCU, inc
4343

4444
# Code Organization
4545
```
46-
examples\arm-cm\dpp_nucleo-c031c6
46+
examples\arm-cm\dpp_nucleo-u545re
4747
|
48-
+---qk // preemptive QK kernel
49-
| +---gnu // GNU-ARM toolchain
48+
+---qk // preemptive QK kernel
49+
| +---gnu // GNU-ARM toolchain
5050
| | \---targetConfigs
5151
| | Makefile // Makefile for GNU-ARM
52-
| +---armclang // ARM/KEIL toolchain with Compiler 6 (ARM/CLANG)
53-
| | dpp-qk.uvprojx // uVision project
54-
| \---iar // IAR EWARM
55-
| dpp-qk.eww // IAR EW-ARM workspace
52+
| +---armclang // ARM/KEIL toolchain with Compiler 6 (ARM/CLANG)
53+
| | dpp-qk.uvprojx // uVision project
54+
| \---iar // IAR EWARM
55+
| dpp-qk.eww // IAR EW-ARM workspace
5656
|
57-
\---qv // cooperative QK kernel
58-
| +---gnu // GNU-ARM toolchain
57+
\---qv // cooperative QK kernel
58+
| +---gnu // GNU-ARM toolchain
5959
| | \---targetConfigs
6060
| | Makefile // Makefile for GNU-ARM
61-
| +---armclang // ARM/KEIL toolchain with Compiler 6 (ARM/CLANG)
62-
| | dpp-qv.uvprojx // uVision project
63-
| \---iar // IAR EWARM
64-
| dpp-qv.eww // IAR EW-ARM workspace
61+
| +---armclang // ARM/KEIL toolchain with Compiler 6 (ARM/CLANG)
62+
| | dpp-qv.uvprojx // uVision project
63+
| \---iar // IAR EWARM
64+
| dpp-qv.eww // IAR EW-ARM workspace
6565
|
66-
+---qxk // preemptive, dual-mode QXK kernel
67-
| +---gnu // GNU-ARM toolchain
66+
+---qxk // preemptive, dual-mode QXK kernel
67+
| +---gnu // GNU-ARM toolchain
6868
| | \---targetConfigs
6969
| | Makefile // Makefile for GNU-ARM
70-
| +---armclang // ARM/KEIL toolchain with Compiler 6 (ARM/CLANG)
71-
| | dpp-qxk.uvprojx // uVision project
72-
| \---iar // IAR EWARM
73-
| dpp-qxk.eww // IAR EW-ARM workspace
70+
| +---armclang // ARM/KEIL toolchain with Compiler 6 (ARM/CLANG)
71+
| | dpp-qxk.uvprojx // uVision project
72+
| \---iar // IAR EWARM
73+
| dpp-qxk.eww // IAR EW-ARM workspace
7474
|
7575
```
7676

7777
# Building the example
7878

7979
### GNU/ARM
8080
- open terminal window
81-
- change to the desired directory (either `examples\arm-cm\dpp_nucleo-c031c6\qk\gnu`, `examples\arm-cm\dpp_nucleo-c031c6\qv\gnu`, or `examples\arm-cm\dpp_nucleo-c031c6\qxk\gnu`)
81+
- change to the desired directory (either `examples\arm-cm\dpp_nucleo-u545re\qk\gnu`, `examples\arm-cm\dpp_nucleo-u545re\qv\gnu`, or `examples\arm-cm\dpp_nucleo-u545re\qxk\gnu`)
8282
- to build the default Debug configuration, type:
8383

8484
```

arm-cm/dpp_nucleo-u545re/qk/armclang/README.txt

Lines changed: 0 additions & 74 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This version of IAR does not support STM32U545RETQ.
2+
Therefore, the selected device is: STM32U575RQ
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This version of IAR does not support STM32U545RETQ.
2+
Therefore, the selected device is: STM32U575RQ

arm-cm/dpp_nucleo-u545re/qxk/gnu/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#
4545
# NOTE:
4646
# To use this Makefile on Windows, you will need the GNU make utility, which
47-
# is included in the Qtools collection for Windows, see:
47+
# is included in the QTools collection for Windows, see:
4848
# https://github.com/QuantumLeaps/qtools
4949

5050
#-----------------------------------------------------------------------------
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This version of IAR does not support STM32U545RETQ.
2+
Therefore, the selected device is: STM32U575RQ

qview-dpp/dpp.py

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@
99
# trace record QS_USER_00 (PHILO_STAT) produced when the status of
1010
# a Philo changes.
1111

12-
class DPP:
13-
def __init__(self):
12+
from qview import QView
13+
from tkinter import *
14+
from tkinter.ttk import * # override the basic Tk widgets with Ttk widgets
1415

16+
class DPP(QView):
17+
# on_init() callback
18+
def on_init(self):
1519
# add commands to the Custom menu...
1620
QView.custom_menu.add_command(label="Custom command",
1721
command=self.cust_command)
@@ -22,9 +26,9 @@ def __init__(self):
2226

2327
# tuple of activity images (correspond to self._philo_state)
2428
self._act_img = (
25-
PhotoImage(file=HOME_DIR + "/img/thinking.gif"),
26-
PhotoImage(file=HOME_DIR + "/img/hungry.gif"),
27-
PhotoImage(file=HOME_DIR + "/img/eating.gif"),
29+
PhotoImage(file="img/thinking.gif"),
30+
PhotoImage(file="img/hungry.gif"),
31+
PhotoImage(file="img/eating.gif"),
2832
)
2933
# tuple of philo canvas images (correspond to self._philo_obj)
3034
self._philo_img = (\
@@ -36,8 +40,8 @@ def __init__(self):
3640
)
3741

3842
# button images for UP and DOWN
39-
self.img_UP = PhotoImage(file=HOME_DIR + "/img/BTN_UP.gif")
40-
self.img_DWN = PhotoImage(file=HOME_DIR + "/img/BTN_DWN.gif")
43+
self.img_UP = PhotoImage(file="img/BTN_UP.gif")
44+
self.img_DWN = PhotoImage(file="img/BTN_DWN.gif")
4145

4246
# images of a button for pause/serve
4347
self.btn = QView.canvas.create_image(200, 120, image=self.img_UP)
@@ -46,22 +50,27 @@ def __init__(self):
4650
# request target reset on startup...
4751
# NOTE: Normally, for an embedded application you would like
4852
# to start with resetting the Target, to start clean with
49-
# Qs dictionaries, etc.
50-
reset_target()
53+
# QS dictionaries, etc.
54+
QView.reset_target()
5155

52-
# on_reset() callback
56+
57+
# on_reset() callback invoked when Target-reset packet is received
58+
# NOTE: the QS dictionaries are not known at this time yet, so
59+
# this callback shouild generally not set filters or current objects
5360
def on_reset(self):
5461
# clear the lists
5562
self._philo_obj = [0, 0, 0, 0, 0]
5663
self._philo_state = [0, 0, 0]
5764

58-
# on_run() callback
65+
# on_run() callback invoked when the QF_RUN packet is received
66+
# NOTE: the QS dictionaries are typically known at this time yet, so
67+
# this callback can set filters or current objects
5968
def on_run(self):
60-
glb_filter("QS_USER_00")
69+
QView.glb_filter("QS_USER_00")
6170

6271
# NOTE: the names of objects for current_obj() must match
6372
# the QS Object Dictionaries produced by the application.
64-
current_obj(OBJ_AO, "Table_inst")
73+
QView.current_obj(QView.OBJ_AO, "Table_inst")
6574

6675
# turn lists into tuples for better performance
6776
self._philo_obj = tuple(self._philo_obj)
@@ -70,17 +79,17 @@ def on_run(self):
7079

7180
# example of a custom command
7281
def cust_command(self):
73-
command(1, 12345)
82+
QView.command(1, 12345)
7483

7584
# example of a custom interaction with a canvas object (pause/serve)
7685
def cust_pause(self, event):
7786
if QView.canvas.itemcget(self.btn, "image") != str(self.img_UP):
7887
QView.canvas.itemconfig(self.btn, image=self.img_UP)
79-
post("SERVE_SIG")
88+
QView.post("SERVE_SIG")
8089
QView.print_text("Table SERVING")
8190
else:
8291
QView.canvas.itemconfig(self.btn, image=self.img_DWN)
83-
post("PAUSE_SIG")
92+
QView.post("PAUSE_SIG")
8493
QView.print_text("Table PAUSED")
8594

8695
# Intercept the QS_USER_00 application-specific trace record.
@@ -89,7 +98,7 @@ def cust_pause(self, event):
8998
# format-byte, Zero-terminated string (status)
9099
def QS_USER_00(self, packet):
91100
# unpack: Timestamp->data[0], Philo-num->data[1], status->data[3]
92-
data = qunpack("xxTxBxZ", packet)
101+
data = QView.qunpack("xxTxBxZ", packet)
93102
i = data[1]
94103
j = ("t", "h", "e").index(data[2][0]) # the first letter
95104

@@ -100,4 +109,5 @@ def QS_USER_00(self, packet):
100109
QView.print_text("%010d Philo %1d is %s"%(data[0], i, data[2]))
101110

102111
#=============================================================================
103-
QView.customize(DPP()) # set the QView customization
112+
if __name__ == "__main__":
113+
QView.main(DPP())

0 commit comments

Comments
 (0)