You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The lldb transcripts and code snippets in this guide had drifted
from the tutorial source as it evolved, so readers following along
would see paths and line references that no longer match:
- Correct the example directory name in the target-create commands
(rpi-pico2-lldb -> rpi-pico-lldb)
- Refresh stale line numbers across the backtrace, frame-select,
and breakpoint transcripts to match the current Application,
OnboardLED, MemoryI2CDevice, and I2C sources
- Fix invalid Swift in the walkthrough snippets: guard-bind the
optional read instead of force-unwrapping, and add the missing
let to the ledPin declaration
All snippets and line references were verified against the current
tutorial sources.
---------
Co-authored-by: Boisy Pitre <bpitre@apple.com>
Co-authored-by: CMD <80255379+iCMDdev@users.noreply.github.com>
Current executable set to '/Users/cmd/swift-embedded-examples/rpi-pico2-lldb/start-tutorial/.build/armv7em-apple-none-macho/debug/Application' (armv7em).
Current executable set to '/Users/cmd/swift-embedded-examples/rpi-pico-lldb/start-tutorial/.build/armv7em-apple-none-macho/debug/Application' (armv7em).
Current executable set to '/Users/cmd/swift-embedded-examples/rpi-pico2-lldb/start-tutorial/.build/armv7em-apple-none-macho/debug/Application' (armv7em)
Current executable set to '/Users/cmd/swift-embedded-examples/rpi-pico-lldb/start-tutorial/.build/armv7em-apple-none-macho/debug/Application' (armv7em)
348
370
(lldb) breakpoint set --hardware -n main
349
371
Breakpoint 1: 2 locations.
350
372
(lldb) br list
351
373
Current breakpoints:
352
374
1: name = 'main', locations = 2, resolved = 2, hit count = 0
353
-
1.1: where = Application`static Application.main() + 24 at Application.swift:93:5, address = 0x20000bb8, resolved, hardware, hit count = 0
375
+
1.1: where = Application`static Application.main() + 24 at Application.swift:104:5, address = 0x20000bb8, resolved, hardware, hit count = 0
354
376
1.2: where = Application`Application_main at Application.swift, address = 0x20000d70, resolved, hardware, hit count = 0
frame #0: 0x20000bb8 Application`static Application.main() at Application.swift:93:5
403
-
90 @main
404
-
91 struct Application {
405
-
92 static func main() {
406
-
-> 93 enableInterfaces()
407
-
94 let controller = I2CController(i2c0SclPin: i2c0SclPin, i2c0SdaPin: i2c0SdaPin)
408
-
95 let memory = MemoryI2CDevice(i2c1SclPin: i2c1SclPin, i2c1SdaPin: i2c1SdaPin)
409
-
96
424
+
frame #0: 0x20000bb8 Application`static Application.main() at Application.swift:104:5
425
+
101 @main
426
+
102 struct Application {
427
+
103 static func main() {
428
+
-> 104 enableInterfaces()
429
+
105 let controller = I2CController(i2c0SclPin: i2c0SclPin, i2c0SdaPin: i2c0SdaPin)
430
+
106 let memory = MemoryI2CDevice(i2c1SclPin: i2c1SclPin, i2c1SdaPin: i2c1SdaPin)
431
+
107
410
432
Target 0: (Application) stopped.
411
433
(lldb)
412
434
```
@@ -436,23 +458,23 @@ note: This address is not associated with a specific line of code. This may be d
436
458
* thread #1
437
459
* frame #0: 0x20002dce Application`generic specialization <serialized, RP2350.I2C0.IC_STATUS> of MMIO.Register.init(unsafeAddress: Swift.UInt) -> MMIO.Register<τ_0_0> at <compiler-generated>:0
438
460
frame #1: 0x200048de Application`RP2350.I2C0.ic_status.getter : MMIO.Register<RP2350.I2C0.IC_STATUS> at @__swiftmacro_6RP23504I2C0V9ic_status13RegisterBlockfMa_.swift:6:15
439
-
frame #2: 0x200031dc Application`closure #1 () -> Swift.Bool in Application.MemoryI2CDevice.receiveBytesToMemory() -> () at MemoryI2CDevice.swift:60:18
440
-
frame #3: 0x200022ec Application`Application.waitForCondition(() -> Swift.Bool) -> () at I2C.swift:42:8
441
-
frame #4: 0x20003194 Application`Application.MemoryI2CDevice.receiveBytesToMemory() -> () at MemoryI2CDevice.swift:59:9
442
-
frame #5: 0x20000c18 Application`static Application.Application.main() -> () at Application.swift:108:12
461
+
frame #2: 0x200031dc Application`closure #1 () -> Swift.Bool in Application.MemoryI2CDevice.receiveBytesToMemory() -> () at MemoryI2CDevice.swift:71:18
462
+
frame #3: 0x200022ec Application`Application.waitForCondition(() -> Swift.Bool) -> () at I2C.swift:51:8
463
+
frame #4: 0x20003194 Application`Application.MemoryI2CDevice.receiveBytesToMemory() -> () at MemoryI2CDevice.swift:70:9
464
+
frame #5: 0x20000c18 Application`static Application.Application.main() -> () at Application.swift:120:12
443
465
frame #6: 0x20000d6c Application`static Application.Application.$main() -> () at <compiler-generated>:0
444
466
frame #7: 0x20000d78 Application`Application_main at Application.swift:0
445
-
frame #8: 0x200053f6 Application`reset at Support.c:87:19
467
+
frame #8: 0x200053f6 Application`reset at Support.c:92:19
446
468
frame #9: 0x000002f4
447
469
(lldb) frame sel 3
448
-
frame #3: 0x200022ec Application`Application.waitForCondition(() -> Swift.Bool) -> () at I2C.swift:42:8
449
-
39 @inline(__always)
450
-
40 func waitForCondition(_ cond: () -> Bool) {
451
-
41 while true {
452
-
-> 42 if cond() { return }
453
-
43 nop()
454
-
44 }
455
-
45 }
470
+
frame #3: 0x200022ec Application`Application.waitForCondition(() -> Swift.Bool) -> () at I2C.swift:51:8
471
+
48 @inline(__always)
472
+
49 func waitForCondition(_ cond: () -> Bool) {
473
+
50 while true {
474
+
-> 51 if cond() { return }
475
+
52 nop()
476
+
53 }
477
+
54 }
456
478
```
457
479
458
480
> Note: This time, when interrupting the program, you may end up stopping at a different place, since the board is continuously looping over some instructions. However, from the third frame 3 onwards, everything should look similar.
@@ -541,13 +563,13 @@ note: This address is not associated with a specific line of code. This may be d
541
563
* frame #0: 0x20001b88 Application`generic specialization <Swift.UnsafeMutablePointer<Swift.UInt32>> of Swift.Optional.unsafelyUnwrapped.getter : τ_0_0 at <compiler-generated>:0
542
564
frame #1: 0x200019e2 Application`generic specialization <RP2350.I2C0.IC_STATUS> of MMIO.Register.pointer.getter : Swift.UnsafeMutablePointer<τ_0_0.Raw.Storage> at Register.swift:180:43
543
565
frame #2: 0x20000ae8 Application`generic specialization <RP2350.I2C0.IC_STATUS> of MMIO.Register.read() -> τ_0_0.Read at Register.swift:216:49
544
-
frame #3: 0x200031e0 Application`closure #1 () -> Swift.Bool in Application.MemoryI2CDevice.receiveBytesToMemory() -> () at MemoryI2CDevice.swift:60:28
545
-
frame #4: 0x200022ec Application`Application.waitForCondition(() -> Swift.Bool) -> () at I2C.swift:42:8
546
-
frame #5: 0x20003194 Application`Application.MemoryI2CDevice.receiveBytesToMemory() -> () at MemoryI2CDevice.swift:59:9
547
-
frame #6: 0x20000c18 Application`static Application.Application.main() -> () at Application.swift:108:12
566
+
frame #3: 0x200031e0 Application`closure #1 () -> Swift.Bool in Application.MemoryI2CDevice.receiveBytesToMemory() -> () at MemoryI2CDevice.swift:71:28
567
+
frame #4: 0x200022ec Application`Application.waitForCondition(() -> Swift.Bool) -> () at I2C.swift:51:8
568
+
frame #5: 0x20003194 Application`Application.MemoryI2CDevice.receiveBytesToMemory() -> () at MemoryI2CDevice.swift:70:9
569
+
frame #6: 0x20000c18 Application`static Application.Application.main() -> () at Application.swift:120:12
548
570
frame #7: 0x20000d6c Application`static Application.Application.$main() -> () at <compiler-generated>:0
549
571
frame #8: 0x20000d78 Application`Application_main at Application.swift:0
550
-
frame #9: 0x200053f6 Application`reset at Support.c:87:19
572
+
frame #9: 0x200053f6 Application`reset at Support.c:92:19
0 commit comments