-
Notifications
You must be signed in to change notification settings - Fork 1.3k
2.9 issue#3859 #3975
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
base: 2.9
Are you sure you want to change the base?
2.9 issue#3859 #3975
Changes from all commits
be317a9
522c5a0
b829a73
369bbcb
64ca2ec
e5e20ce
640978a
2d218f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
|
|
||
| This is a test of the hm2_modbus driver parameter settings. | ||
|
|
||
| Create a fake device using dump_config.sh. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #!/bin/bash | ||
|
|
||
| # | ||
| # This script will dump the current configuration memory to the command line. | ||
| # Use ./dump_config.sh >> test_pattern15.h to capture your configuration to a file. Replace 7i96 with your firmware name. | ||
|
|
||
| # Want to use --rpo from 0x0000 - 0x6100. | ||
|
Comment on lines
+4
to
+7
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This and the other dump script will only work if you have the specific card and it is on the network. The more versatile way is to create the config from the bit-file and make that loadable by the hm2_test component. Then you don't have any static config in the test component either. |
||
| # | ||
| ADDR=0 | ||
| #END=0x6100 or decimal 24832 | ||
|
|
||
| # format output in columns. | ||
| COLUMN=0 | ||
|
|
||
| echo "/*" | ||
| echo " Header file containing configuration memory dump." | ||
| echo " You may use tests/hm-test/dump_config.sh to create this file." | ||
| echo "*/" | ||
| echo "" | ||
| echo "#pragma once" | ||
| echo "" | ||
| echo "const uint32_t config_memory_dump[] = {" | ||
|
|
||
| while [ $ADDR -lt 24832 ] | ||
| do | ||
| echo -n "0x" | ||
|
|
||
| mesaflash --addr 10.10.10.10 --device 7i96 --rpo $ADDR | tr "\n" ", " | ||
|
|
||
| if [ $COLUMN -lt 7 ]; then | ||
| COLUMN=$(( $COLUMN + 1 )) | ||
| else | ||
| COLUMN=0 | ||
| echo "" | ||
| fi | ||
|
|
||
| ADDR=$(( $ADDR + 4 )) | ||
| done | ||
|
|
||
| echo "};" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #!/bin/bash | ||
|
|
||
| # | ||
| # This script will dump the current configuration memory to the command line. | ||
| # Use ./dump_config.sh >> test_pattern15.h to capture your configuration to a file. Replace 7i96 with your firmware name. | ||
| # Use ./dump_config.sh >> test_pattern15.b to capture your configuration to a binary file. | ||
|
|
||
| # Want to use --rpo from 0x0000 - 0x6100. | ||
| # | ||
| ADDR=0 | ||
| #END=0x6100 or decimal 24832 | ||
|
|
||
| # format output in columns. | ||
| COLUMN=0 | ||
|
|
||
| echo "/*" | ||
| echo " Header file containing configuration memory dump." | ||
| echo " You may use tests/hm-test/dump_config.sh to create this file." | ||
| echo "*/" | ||
| echo "" | ||
| echo "#pragma once" | ||
| echo "" | ||
| echo "const uint32_t config_memory_dump[] = {" | ||
|
|
||
|
|
||
| while [ $ADDR -lt 24832 ] | ||
| do | ||
| echo -n "0x" | ||
|
|
||
| v=$(mesaflash --addr 10.10.10.10 --device 7i96 --rpo $ADDR) | ||
|
|
||
| echo "mesaflash returns $v for $ADDR" | ||
| #var_value=$(echo "${arr[3]}" | sed 's/0x0\+//') | ||
|
|
||
| print "%u" $ADDR | ||
|
|
||
| ADDR=$(( $ADDR + 4 )) | ||
| done | ||
|
|
||
| echo "};" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
|
|
||
| baudrate = 1200 | ||
| drivedelay = 2 | ||
| icdelay = 16 | ||
| parity = 2 | ||
| rxdelay = 38 | ||
| stopbits = 1 | ||
| txdelay = 40 | ||
|
|
||
| baudrate = 19200 | ||
| drivedelay = 1 | ||
| icdelay = 16 | ||
| parity = 3 | ||
| rxdelay = 38 | ||
| stopbits = 1 | ||
| txdelay = 40 | ||
|
|
||
| baudrate = 19200 | ||
| drivedelay = 3 | ||
| icdelay = 16 | ||
| parity = 2 | ||
| rxdelay = 38 | ||
| stopbits = 1 | ||
| txdelay = 40 | ||
|
|
||
| baudrate = 38400 | ||
| drivedelay = 1 | ||
| icdelay = 29 | ||
| parity = 0 | ||
| rxdelay = 67 | ||
| stopbits = 2 | ||
| txdelay = 69 | ||
|
|
||
| baudrate = 115200 | ||
| drivedelay = 1 | ||
| icdelay = 87 | ||
| parity = 2 | ||
| rxdelay = 201 | ||
| stopbits = 1 | ||
| txdelay = 203 | ||
|
|
||
| baudrate = 1000000 | ||
| drivedelay = 1 | ||
| icdelay = 255 | ||
| parity = 2 | ||
| rxdelay = 1019 | ||
| stopbits = 1 | ||
| txdelay = 1021 | ||
| Number of errors 0 | ||
| All tests passed. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # | ||
| # HAL for modbus testing. | ||
| # | ||
| #loadrt hostmot2 debug_idrom=1 debug_pin_descriptors=1 debug_module_descriptors=1 | ||
| loadrt hostmot2 | ||
|
|
||
| # | ||
| # Load hm2_test that allows us to run test without physical mesa board or ethernet or RS485. | ||
| # TEST_PATTERN goes to the realtime hm2_test component. | ||
| # | ||
| loadrt hm2_test test_pattern=$(TEST_PATTERN) | ||
|
|
||
| # | ||
| # Now load the component with the configuration we want to test. | ||
| # | ||
| loadrt hm2_modbus ports=hm2_test.0.pktuart.0 mbccbs=$(TEST_MBCCB) | ||
| show param hm2_modbus.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These do not belong in the top-level .gitignore file. These need to go into a local file at
tests/hm2-modus/.gitignoreAlso, they are absolute paths that should be relative.