Skip to content

Apollo3: Implement AnalogIn and PwmOut #476

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

Merged
merged 8 commits into from
Jul 23, 2025

Conversation

multiplemonomials
Copy link
Collaborator

@multiplemonomials multiplemonomials commented Jul 21, 2025

Summary of changes

This PR implements ADC and PWM support for Ambiq Apollo3, rounding out the basic Mbed HALs available on this target. The HALs largely pass the Mbed CI shield compliance testing, meaning that they should work how users expect them to.

This implementation was based on the SparkFun Arduino code code found here: https://github.com/sparkfun/Arduino_Apollo3/blob/main/cores/arduino/sdk/core-implement/CommonAnalog.cpp . However, I made some improvements:

  • All needed mapping information is stored in the Mbed pin maps
  • PWM can now use any of the available clock frequencies, and automatically selects the best one. This means that PWM frequency can be anywhere from 1MHz to less than 1Hz.
  • Invalid frequency and period settings are detected and reported with a useful error message
  • Calibration of the HFRC oscillator is turned on, so the PWM frequency is a fair bit more accurate

Impact of changes

  • Apollo3 now supports AnalogIn
  • Apollo3 now supports PwmOut
  • Apollo3 now enables HFRC oscillator calibration, so the CPU core clock and the us ticker will be more accurate

Migration actions required

Documentation

Doc page created: https://mbed-ce.dev/mcu-info/AMA3B1KK/


Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[X] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

I ran this PR with the CI shield PWM test. It passed except that the duty cycle accuracy is not very good -- the test expects +-0.1% but we seem to be off by 0.2% in some cases. I think this is an issue with my test setup (currently out of town so using my Windows laptop) and will keep investigating, but I don't want to hold up this PR because of it.

11: [+3113ms][CONN][RXD] mbedmbedmbedmbedmbedmbedmbedmbed
11: [+3124ms][CONN][INF] found KV pair in stream: {{__sync;69f55836-2a18-4a89-b412-e03dd1b9e72e}}, queued...
11: [+3124ms][CONN][INF] found KV pair in stream: {{__version;1.3.0}}, queued...
11: [+3124ms][CONN][INF] found KV pair in stream: {{__timeout;75}}, queued...
11: [+3124ms][CONN][INF] found SYNC in stream: {{__sync;69f55836-2a18-4a89-b412-e03dd1b9e72e}} it is #0 sent, queued...
11: [+5544ms][HTST][INF] sync KV found, uuid=69f55836-2a18-4a89-b412-e03dd1b9e72e, timestamp=1753159211.605853
11: [+5544ms][HTST][INF] DUT greentea-client version: 1.3.0
11: [+5544ms][HTST][INF] setting timeout to: 75 sec
11: [+3136ms][CONN][INF] found KV pair in stream: {{__host_test_name;signal_analyzer_test}}, queued...
11: [+3136ms][CONN][RXD] >>> Running 10 test cases...
11: [+3136ms][CONN][INF] found KV pair in stream: {{__testcase_name;Test that target.default-adc-vref is set}}, queued...
11: [+5556ms][HTST][INF] host test class: '<class 'signal_analyzer_test.SignalAnalyzerHostTest'>'
11: [+5556ms][TEST][INF] Signal Analyzer Test host test setup complete.
11: [+5556ms][HTST][INF] host test setup() call...
11: [+5556ms][HTST][INF] CALLBACKs updated
11: [+5556ms][HTST][INF] host test detected: signal_analyzer_test
11: [+3148ms][CONN][INF] found KV pair in stream: {{__testcase_name;Test reading digital values with the ADC}}, queued...
11: [+3148ms][CONN][INF] found KV pair in stream: {{__testcase_name;Test reading analog values with the ADC}}, queued...
11: [+3158ms][CONN][INF] found KV pair in stream: {{__testcase_name;Test PWM frequency and duty cycle (freq = 50 Hz)}}, queued...
11: [+3158ms][CONN][INF] found KV pair in stream: {{__testcase_name;Test PWM frequency and duty cycle (freq = 1 kHz)}}, queued...
11: [+3170ms][CONN][INF] found KV pair in stream: {{__testcase_name;Test PWM frequency and duty cycle (freq = 10 kHz)}}, queued...
11: [+3181ms][CONN][INF] found KV pair in stream: {{__testcase_name;Test PWM frequency and duty cycle (freq = 100 kHz)}}, queued...
11: [+3181ms][CONN][INF] found KV pair in stream: {{__testcase_name;Test PWM frequency and duty cycle (freq = 1 MHz)}}, queued...
11: [+3192ms][CONN][INF] found KV pair in stream: {{__testcase_name;Test PWM Suspend/Resume (freq = 1kHz)}}, queued...
11: [+3192ms][CONN][INF] found KV pair in stream: {{__testcase_name;Test PWM Maintains Duty Cycle (freq = 1kHz)}}, queued...
11: [+3192ms][CONN][RXD]
11: [+3204ms][CONN][RXD] >>> Running case #1: 'Test that target.default-adc-vref is set'...
11: [+3204ms][CONN][INF] found KV pair in stream: {{__testcase_start;Test that target.default-adc-vref is set}}, queued...
11: [+3215ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Test that target.default-adc-vref is set;1;0}}, queued...
11: [+3226ms][CONN][RXD] >>> 'Test that target.default-adc-vref is set': 1 passed, 0 failed
11: [+3226ms][CONN][RXD] <greentea test suite>:0::PASS
11: [+3226ms][CONN][RXD]
11: [+3226ms][CONN][RXD] >>> Running case #2: 'Test reading digital values with the ADC'...
11: [+3237ms][CONN][INF] found KV pair in stream: {{__testcase_start;Test reading digital values with the ADC}}, queued...
11: [+3269ms][CONN][RXD] With the PWM at full off, the ADC reads 0.0% of reference voltage.
11: [+3323ms][CONN][RXD] With the PWM at full on, the ADC reads 100.0% of reference voltage.
11: [+3323ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Test reading digital values with the ADC;1;0}}, queued...
11: [+3334ms][CONN][RXD] >>> 'Test reading digital values with the ADC': 1 passed, 0 failed
11: [+3334ms][CONN][RXD] <greentea test suite>:0::PASS
11: [+3334ms][CONN][RXD]
11: [+3345ms][CONN][RXD] >>> Running case #3: 'Test reading analog values with the ADC'...
11: [+3345ms][CONN][INF] found KV pair in stream: {{__testcase_start;Test reading analog values with the ADC}}, queued...
11: [+3377ms][CONN][RXD] PWM duty cycle of 0.0% produced an ADC reading of 0.0% (expected 0.0%)
11: [+3432ms][CONN][RXD] PWM duty cycle of 10.0% produced an ADC reading of 16.2% (expected 16.5%)
11: [+3485ms][CONN][RXD] PWM duty cycle of 20.0% produced an ADC reading of 32.2% (expected 33.0%)
11: [+3528ms][CONN][RXD] PWM duty cycle of 30.0% produced an ADC reading of 48.1% (expected 49.5%)
11: [+3582ms][CONN][RXD] PWM duty cycle of 40.0% produced an ADC reading of 65.8% (expected 66.0%)
11: [+3625ms][CONN][RXD] PWM duty cycle of 50.0% produced an ADC reading of 82.7% (expected 82.5%)
11: [+3679ms][CONN][RXD] PWM duty cycle of 60.0% produced an ADC reading of 99.8% (expected 99.0%)
11: [+3733ms][CONN][RXD] PWM duty cycle of 70.0% produced an ADC reading of 100.0% (expected 100.0%)
11: [+3776ms][CONN][RXD] PWM duty cycle of 80.0% produced an ADC reading of 100.0% (expected 100.0%)
11: [+3830ms][CONN][RXD] PWM duty cycle of 90.0% produced an ADC reading of 100.0% (expected 100.0%)
11: [+3885ms][CONN][RXD] PWM duty cycle of 100.0% produced an ADC reading of 100.0% (expected 100.0%)
11: [+3885ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Test reading analog values with the ADC;1;0}}, queued...
11: [+3896ms][CONN][RXD] >>> 'Test reading analog values with the ADC': 1 passed, 0 failed
11: [+3896ms][CONN][RXD] <greentea test suite>:0::PASS
11: [+3896ms][CONN][RXD]
11: [+3907ms][CONN][RXD] >>> Running case #4: 'Test PWM frequency and duty cycle (freq = 50 Hz)'...
11: [+3907ms][CONN][INF] found KV pair in stream: {{__testcase_start;Test PWM frequency and duty cycle (freq = 50 Hz)}}, queued...
11: [+3907ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+5290ms][SERI][TXD] {{frequency;50.0}}
11: [+5301ms][SERI][TXD] {{duty_cycle;0.45892155808831436}}
11: [+5323ms][CONN][RXD] Expected PWM frequency was 50 Hz (+- 20 Hz) and duty cycle was 45.85% (+-0.10%), host measured frequency 50 Hz and duty cycle 45.89%
11: [+5323ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+6704ms][SERI][TXD] {{frequency;50.0}}
11: [+6714ms][SERI][TXD] {{duty_cycle;0.11861411039417204}}
11: [+6736ms][CONN][RXD] Expected PWM frequency was 50 Hz (+- 20 Hz) and duty cycle was 11.85% (+-0.10%), host measured frequency 50 Hz and duty cycle 11.86%
11: [+6737ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+8128ms][SERI][TXD] {{frequency;50.0}}
11: [+8140ms][SERI][TXD] {{duty_cycle;0.8407961940285448}}
11: [+8162ms][CONN][RXD] Expected PWM frequency was 50 Hz (+- 20 Hz) and duty cycle was 84.00% (+-0.10%), host measured frequency 50 Hz and duty cycle 84.08%
11: [+8162ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+9566ms][SERI][TXD] {{frequency;50.0}}
11: [+9577ms][SERI][TXD] {{duty_cycle;0.9933725497058772}}
11: [+9598ms][CONN][RXD] Expected PWM frequency was 50 Hz (+- 20 Hz) and duty cycle was 99.34% (+-0.10%), host measured frequency 50 Hz and duty cycle 99.34%
11: [+9598ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+10983ms][SERI][TXD] {{frequency;50.0}}
11: [+10995ms][SERI][TXD] {{duty_cycle;0.807768941732937}}
11: [+11017ms][CONN][RXD] Expected PWM frequency was 50 Hz (+- 20 Hz) and duty cycle was 80.80% (+-0.10%), host measured frequency 50 Hz and duty cycle 80.78%
11: [+11029ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Test PWM frequency and duty cycle (freq = 50 Hz);1;0}}, queued...
11: [+11029ms][CONN][RXD] >>> 'Test PWM frequency and duty cycle (freq = 50 Hz)': 1 passed, 0 failed
11: [+11040ms][CONN][RXD] <greentea test suite>:0::PASS
11: [+11040ms][CONN][RXD]
11: [+11040ms][CONN][RXD] >>> Running case #5: 'Test PWM frequency and duty cycle (freq = 1 kHz)'...
11: [+11051ms][CONN][INF] found KV pair in stream: {{__testcase_start;Test PWM frequency and duty cycle (freq = 1 kHz)}}, queued...
11: [+11051ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+12447ms][SERI][TXD] {{frequency;1000.0}}
11: [+12458ms][SERI][TXD] {{duty_cycle;0.9927525543558423}}
11: [+12480ms][CONN][RXD] Expected PWM frequency was 1000 Hz (+- 21 Hz) and duty cycle was 99.28% (+-0.10%), host measured frequency 1000 Hz and duty cycle 99.28%
11: [+12480ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+13851ms][SERI][TXD] {{frequency;995.0}}
11: [+13862ms][SERI][TXD] {{duty_cycle;0.45845406159453805}}
11: [+13884ms][CONN][RXD] Expected PWM frequency was 1000 Hz (+- 21 Hz) and duty cycle was 45.87% (+-0.10%), host measured frequency 995 Hz and duty cycle 45.85%
11: [+13895ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+15274ms][SERI][TXD] {{frequency;1000.0}}
11: [+15285ms][SERI][TXD] {{duty_cycle;0.5564708264688015}}
11: [+15306ms][CONN][RXD] Expected PWM frequency was 1000 Hz (+- 21 Hz) and duty cycle was 55.61% (+-0.10%), host measured frequency 1000 Hz and duty cycle 55.65%
11: [+15317ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+16732ms][SERI][TXD] {{frequency;1000.0}}
11: [+16744ms][SERI][TXD] {{duty_cycle;0.039962200283497874}}
11: [+16765ms][CONN][RXD] Expected PWM frequency was 1000 Hz (+- 21 Hz) and duty cycle was 4.00% (+-0.10%), host measured frequency 1000 Hz and duty cycle 4.00%
11: [+16766ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+18157ms][SERI][TXD] {{frequency;1000.0}}
11: [+18169ms][SERI][TXD] {{duty_cycle;0.20244848163638773}}
11: [+18191ms][CONN][RXD] Expected PWM frequency was 1000 Hz (+- 21 Hz) and duty cycle was 20.23% (+-0.10%), host measured frequency 1000 Hz and duty cycle 20.24%
11: [+18202ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Test PWM frequency and duty cycle (freq = 1 kHz);1;0}}, queued...
11: [+18213ms][CONN][RXD] >>> 'Test PWM frequency and duty cycle (freq = 1 kHz)': 1 passed, 0 failed
11: [+18213ms][CONN][RXD] <greentea test suite>:0::PASS
11: [+18213ms][CONN][RXD]
11: [+18224ms][CONN][RXD] >>> Running case #6: 'Test PWM frequency and duty cycle (freq = 10 kHz)'...
11: [+18224ms][CONN][INF] found KV pair in stream: {{__testcase_start;Test PWM frequency and duty cycle (freq = 10 kHz)}}, queued...
11: [+18224ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+19628ms][SERI][TXD] {{frequency;9990.0}}
11: [+19639ms][SERI][TXD] {{duty_cycle;0.49084131869010983}}
11: [+19661ms][CONN][RXD] Expected PWM frequency was 10000 Hz (+- 35 Hz) and duty cycle was 49.21% (+-0.10%), host measured frequency 9990 Hz and duty cycle 49.08%
11: [+19673ms][CONN][RXD] <greentea test suite>:124::FAIL: Expected 0.492057 Was 0.490841
11: [+19673ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+21100ms][SERI][TXD] {{frequency;9990.0}}
11: [+21111ms][SERI][TXD] {{duty_cycle;0.15748381887135846}}
11: [+21132ms][CONN][RXD] Expected PWM frequency was 10000 Hz (+- 35 Hz) and duty cycle was 15.86% (+-0.10%), host measured frequency 9990 Hz and duty cycle 15.75%
11: [+21143ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+22504ms][SERI][TXD] {{frequency;9990.0}}
11: [+22515ms][SERI][TXD] {{duty_cycle;0.3116726624550316}}
11: [+22537ms][CONN][RXD] Expected PWM frequency was 10000 Hz (+- 35 Hz) and duty cycle was 31.23% (+-0.10%), host measured frequency 9990 Hz and duty cycle 31.17%
11: [+22548ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+23926ms][SERI][TXD] {{frequency;9995.0}}
11: [+23937ms][SERI][TXD] {{duty_cycle;0.35754731839511206}}
11: [+23959ms][CONN][RXD] Expected PWM frequency was 10000 Hz (+- 35 Hz) and duty cycle was 35.85% (+-0.10%), host measured frequency 9995 Hz and duty cycle 35.75%
11: [+23970ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+25362ms][SERI][TXD] {{frequency;9990.0}}
11: [+25373ms][SERI][TXD] {{duty_cycle;0.24914063144526416}}
11: [+25395ms][CONN][RXD] Expected PWM frequency was 10000 Hz (+- 35 Hz) and duty cycle was 25.02% (+-0.10%), host measured frequency 9990 Hz and duty cycle 24.91%
11: [+25408ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Test PWM frequency and duty cycle (freq = 10 kHz);0;1}}, queued...
11: [+25419ms][CONN][RXD] >>> 'Test PWM frequency and duty cycle (freq = 10 kHz)': 0 passed, 1 failed with reason 'Test Cases Failed'
11: [+25420ms][CONN][RXD]
11: [+25420ms][CONN][RXD]
11: [+25420ms][CONN][RXD] >>> Running case #7: 'Test PWM frequency and duty cycle (freq = 100 kHz)'...
11: [+25430ms][CONN][INF] found KV pair in stream: {{__testcase_start;Test PWM frequency and duty cycle (freq = 100 kHz)}}, queued...
11: [+25431ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+26780ms][SERI][TXD] {{frequency;99910.0}}
11: [+26792ms][SERI][TXD] {{duty_cycle;0.8082439381704637}}
11: [+26813ms][CONN][RXD] Expected PWM frequency was 100000 Hz (+- 170 Hz) and duty cycle was 81.60% (+-1.00%), host measured frequency 99910 Hz and duty cycle 80.82%
11: [+26826ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+28201ms][SERI][TXD] {{frequency;99910.0}}
11: [+28212ms][SERI][TXD] {{duty_cycle;0.575093186801099}}
11: [+28234ms][CONN][RXD] Expected PWM frequency was 100000 Hz (+- 170 Hz) and duty cycle was 58.47% (+-1.00%), host measured frequency 99910 Hz and duty cycle 57.51%
11: [+28245ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+29609ms][SERI][TXD] {{frequency;99900.0}}
11: [+29619ms][SERI][TXD] {{duty_cycle;0.6416201878485911}}
11: [+29641ms][CONN][RXD] Expected PWM frequency was 100000 Hz (+- 170 Hz) and duty cycle was 65.00% (+-1.00%), host measured frequency 99900 Hz and duty cycle 64.16%
11: [+29642ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+30964ms][SERI][TXD] {{frequency;99910.0}}
11: [+30975ms][SERI][TXD] {{duty_cycle;0.2414381892135809}}
11: [+30997ms][CONN][RXD] Expected PWM frequency was 100000 Hz (+- 170 Hz) and duty cycle was 25.19% (+-1.00%), host measured frequency 99910 Hz and duty cycle 24.14%
11: [+31009ms][CONN][RXD] <greentea test suite>:124::FAIL: Expected 0.251947 Was 0.241438
11: [+31009ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+32382ms][SERI][TXD] {{frequency;99905.0}}
11: [+32393ms][SERI][TXD] {{duty_cycle;0.5323610072924453}}
11: [+32415ms][CONN][RXD] Expected PWM frequency was 100000 Hz (+- 170 Hz) and duty cycle was 54.09% (+-1.00%), host measured frequency 99905 Hz and duty cycle 53.24%
11: [+32426ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Test PWM frequency and duty cycle (freq = 100 kHz);0;1}}, queued...
11: [+32437ms][CONN][RXD] >>> 'Test PWM frequency and duty cycle (freq = 100 kHz)': 0 passed, 1 failed with reason 'Test Cases Failed'
11: [+32437ms][CONN][RXD]
11: [+32437ms][CONN][RXD]
11: [+32448ms][CONN][RXD] >>> Running case #8: 'Test PWM frequency and duty cycle (freq = 1 MHz)'...
11: [+32448ms][CONN][INF] found KV pair in stream: {{__testcase_start;Test PWM frequency and duty cycle (freq = 1 MHz)}}, queued...
11: [+32448ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+33799ms][SERI][TXD] {{frequency;833900.0}}
11: [+33810ms][SERI][TXD] {{duty_cycle;0.4169493728797034}}
11: [+33832ms][CONN][RXD] Expected PWM frequency was 1000000 Hz (+- 1520 Hz) and duty cycle was 50.90% (+-10.00%), host measured frequency 833900 Hz and duty cycle 41.69%
11: [+33843ms][CONN][RXD] <greentea test suite>:123::FAIL: Expected 1000000.000000 Was 833900.000000
11: [+33843ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+35197ms][SERI][TXD] {{frequency;839845.0}}
11: [+35208ms][SERI][TXD] {{duty_cycle;0.5800681494888789}}
11: [+35229ms][CONN][RXD] Expected PWM frequency was 1000000 Hz (+- 1520 Hz) and duty cycle was 70.31% (+-10.00%), host measured frequency 839845 Hz and duty cycle 58.01%
11: [+35241ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+36590ms][SERI][TXD] {{frequency;667160.0}}
11: [+36601ms][SERI][TXD] {{duty_cycle;0.6664125019062357}}
11: [+36622ms][CONN][RXD] Expected PWM frequency was 1000000 Hz (+- 1520 Hz) and duty cycle was 73.64% (+-10.00%), host measured frequency 667160 Hz and duty cycle 66.64%
11: [+36634ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+37954ms][SERI][TXD] {{frequency;489665.0}}
11: [+37965ms][SERI][TXD] {{duty_cycle;0.24483316375127187}}
11: [+37987ms][CONN][RXD] Expected PWM frequency was 1000000 Hz (+- 1520 Hz) and duty cycle was 33.26% (+-10.00%), host measured frequency 489665 Hz and duty cycle 24.48%
11: [+37998ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+39371ms][SERI][TXD] {{frequency;503445.0}}
11: [+39382ms][SERI][TXD] {{duty_cycle;0.2517231120766594}}
11: [+39403ms][CONN][RXD] Expected PWM frequency was 1000000 Hz (+- 1520 Hz) and duty cycle was 32.09% (+-10.00%), host measured frequency 503445 Hz and duty cycle 25.17%
11: [+39414ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Test PWM frequency and duty cycle (freq = 1 MHz);0;1}}, queued...
11: [+39426ms][CONN][RXD] >>> 'Test PWM frequency and duty cycle (freq = 1 MHz)': 0 passed, 1 failed with reason 'Test Cases Failed'
11: [+39426ms][CONN][RXD]
11: [+39426ms][CONN][RXD]
11: [+39438ms][CONN][RXD] >>> Running case #9: 'Test PWM Suspend/Resume (freq = 1kHz)'...
11: [+39438ms][CONN][INF] found KV pair in stream: {{__testcase_start;Test PWM Suspend/Resume (freq = 1kHz)}}, queued...
11: [+39438ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+40779ms][SERI][TXD] {{frequency;995.0}}
11: [+40790ms][SERI][TXD] {{duty_cycle;0.7500393747046897}}
11: [+40811ms][CONN][RXD] Expected PWM frequency was 1000 Hz (+- 21 Hz) and duty cycle was 75.00% (+-0.10%), host measured frequency 995 Hz and duty cycle 75.00%
11: [+40811ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+42161ms][SERI][TXD] {{frequency;0.0}}
11: [+42172ms][SERI][TXD] {{duty_cycle;0.9999925000562496}}
11: [+42183ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+43526ms][SERI][TXD] {{frequency;995.0}}
11: [+43537ms][SERI][TXD] {{duty_cycle;0.7505643707672193}}
11: [+43559ms][CONN][RXD] Expected PWM frequency was 1000 Hz (+- 21 Hz) and duty cycle was 75.00% (+-0.10%), host measured frequency 995 Hz and duty cycle 75.06%
11: [+43570ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Test PWM Suspend/Resume (freq = 1kHz);1;0}}, queued...
11: [+43570ms][CONN][RXD] >>> 'Test PWM Suspend/Resume (freq = 1kHz)': 1 passed, 0 failed
11: [+43582ms][CONN][RXD] <greentea test suite>:0::PASS
11: [+43582ms][CONN][RXD]
11: [+43582ms][CONN][RXD] >>> Running case #10: 'Test PWM Maintains Duty Cycle (freq = 1kHz)'...
11: [+43593ms][CONN][INF] found KV pair in stream: {{__testcase_start;Test PWM Maintains Duty Cycle (freq = 1kHz)}}, queued...
11: [+43593ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+44945ms][SERI][TXD] {{frequency;995.0}}
11: [+44957ms][SERI][TXD] {{duty_cycle;0.7502793729047033}}
11: [+44979ms][CONN][RXD] Expected PWM frequency was 1000 Hz (+- 21 Hz) and duty cycle was 75.00% (+-0.10%), host measured frequency 995 Hz and duty cycle 75.03%
11: [+44980ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+46312ms][SERI][TXD] {{frequency;39960.0}}
11: [+46323ms][SERI][TXD] {{duty_cycle;0.746649400129499}}
11: [+46345ms][CONN][RXD] Expected PWM frequency was 40000 Hz (+- 80 Hz) and duty cycle was 75.00% (+-0.40%), host measured frequency 39960 Hz and duty cycle 74.66%
11: [+46356ms][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
11: [+47712ms][SERI][TXD] {{frequency;200.0}}
11: [+47723ms][SERI][TXD] {{duty_cycle;0.7497843766171753}}
11: [+47744ms][CONN][RXD] Expected PWM frequency was 200 Hz (+- 20 Hz) and duty cycle was 75.00% (+-0.10%), host measured frequency 200 Hz and duty cycle 74.98%
11: [+47756ms][CONN][INF] found KV pair in stream: {{__testcase_finish;Test PWM Maintains Duty Cycle (freq = 1kHz);1;0}}, queued...
11: [+47756ms][CONN][RXD] >>> 'Test PWM Maintains Duty Cycle (freq = 1kHz)': 1 passed, 0 failed
11: [+47767ms][CONN][RXD] <greentea test suite>:0::PASS
11: [+47767ms][CONN][RXD]
11: [+47767ms][CONN][RXD] >>> Test cases: 7 passed, 3 failed with reason 'Test Cases Failed'
11: [+47778ms][CONN][RXD] >>> TESTS FAILED!
11: [+47778ms][CONN][RXD]
11: [+47778ms][CONN][RXD] -----------------------
11: [+47778ms][CONN][RXD] 0 Tests 3 Failures 0 Ignored 
11: [+47778ms][CONN][RXD] FAIL
11: [+47779ms][CONN][INF] found KV pair in stream: {{__testcase_summary;7;3}}, queued...
11: [+47779ms][CONN][INF] found KV pair in stream: {{end;failure}}, queued...
11: [+47779ms][CONN][INF] found KV pair in stream: {{__exit;0}}, queued...
11: [+50200ms][HTST][INF] __exit(0)
11: [+50200ms][HTST][INF] __notify_complete(False)
11: [+50201ms][HTST][INF] __exit_event_queue received
11: [+50201ms][HTST][INF] test suite run finished after 44.66 sec...

@multiplemonomials multiplemonomials merged commit 853b8bf into master Jul 23, 2025
52 checks passed
@multiplemonomials multiplemonomials deleted the dev/apollo3-implement-adc-pwm branch July 23, 2025 03:09
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

Successfully merging this pull request may close these issues.

2 participants