Skip to content
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

Upgrade packer and send more FF data #201

Merged
merged 21 commits into from
Feb 4, 2024
Merged

Upgrade packer and send more FF data #201

merged 21 commits into from
Feb 4, 2024

Conversation

pkotamnives
Copy link
Contributor

@pkotamnives pkotamnives commented Nov 21, 2023

This PR will close #197

The v2 packer has been implemented, and it is compatible with the current set of data steams. This has been checked on Apollo205, and BUTool status looks consistent with what has been shown before.

Next step is to send all FF-ch optical power outputs, ff xmit on output, and more ff register outputs. Some have also been implemented via CLI. The following list is what missing :

  • peak temperature? currently we send FF temperature per device
  • per rx ch of Received Optical Power(ROP) (currently we send average value of ROP per device)
  • LOL has an implementation via CLI ff_cdr_lol
  • LOS has an implementation via CLI ff_los_alarm
  • missing laser fault (0x9-0x10 for 12-ch or 0x4 for 4-ch)

@pwittich
Copy link
Contributor

@pkotamnives how did you test this? I thought this required a change in the Zynq FW

@pkotamnives
Copy link
Contributor Author

@pkotamnives how did you test this? I thought this required a change in the Zynq FW

Hi Peter, I first checked the BUTool status from cm_mcu.bin that is up-to-date with the master. Then, I reprogrammed the mcu firmware with the cm_mcu.bin after changing the packer to v2 (no change to data steams) and I see the same status unchanged.

there was a bug that I just fixed though. I can re-check again.

@pwittich
Copy link
Contributor

@pkotamnives how did you test this? I thought this required a change in the Zynq FW

Hi Peter, I first checked the BUTool status from cm_mcu.bin that is up-to-date with the master. Then, I reprogrammed the mcu firmware with the cm_mcu.bin after changing the packer to v2 (no change to data steams) and I see the same status unchanged.

there was a bug that I just fixed though. I can re-check again.

yes please, I think we need a new firmware from @dgastler for this to work. Is it possible you were looking at stale values?

@pkotamnives
Copy link
Contributor Author

Hi @pwittich and @dgastler, I have reprogrammed mcu with the master cm_mcu.bin. The BUTool status looks good. Then I changed it to the cm_mcu.bin from the latest commit in this branch. I found that the MCU_UPTIME and other fields were frozen after the packer is changed.
This seems to explain why I thought the code works but actually it's not. Could you update the Zynq FW for this purpose?

@pwittich
Copy link
Contributor

pwittich commented Jan 2, 2024

Thanks for making the changes! I think there might still be some issues; look at the grafana (I fixed the setup so that it shows up again):
https://www.classe.cornell.edu/cms/grafana/psbATCA/d/YVW4b-n4k/rev2-cm-dashboard?orgId=2&refresh=30s&from=1704213966757&to=1704215766757&var-WhichApollo=AP205
the fact that the values glitch to zero (or non-zero) suggests that we still have some issues with overwriting memory to me....

@pkotamnives
Copy link
Contributor Author

Update on rollover/overwrite issue: We found that it is a bug in Task.h (i.e. ZM_NUM_ENTRIES = 256 ) that prevents higher address than 0xFF to be written and the program also crashed when more entries than 256 are sent or overwrote to the first table otherwise. We also changed the sensor type from uint8_t to uint16_t just to be consistent with the data type.

Other bugs and corrections as well as the addition of ff_laser_fault to a list of data sent to Zynq will be merged into this branch from https://github.com/apollo-lhc/cm_mcu/tree/test_packer2rollover

Copy link
Contributor

@pwittich pwittich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

take a look at these changes

sm_cm_config/src/xml_generate.py Outdated Show resolved Hide resolved
sm_cm_config/src/xml_generate.py Outdated Show resolved Hide resolved
sm_cm_config/src/xml_generate.py Outdated Show resolved Hide resolved
sm_cm_config/data/PL_MEM_CM_rev2.yml Show resolved Hide resolved
projects/cm_mcu/LocalTasks.c Outdated Show resolved Hide resolved
projects/cm_mcu/LocalTasks.c Outdated Show resolved Hide resolved
projects/cm_mcu/LocalTasks.c Outdated Show resolved Hide resolved
#define SENSOR_SIX_BITS 0x3F
#define SENSOR_MESSAGE_START_OF_FRAME_NIB 2
#define SENSOR_MESSAGE_START_OF_FRAME_NIB_V2 3
#define RESERVED_DATA 0x9 // 0b1001
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw, this just a dummy value. We don't need to put this in

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what your suggestion is

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mean typing them directly to the code?

projects/cm_mcu/ZynqMonTask.c Outdated Show resolved Hide resolved
@pwittich pwittich merged commit 6e5379e into master Feb 4, 2024
6 checks passed
@pwittich pwittich deleted the dev_packerv2 branch April 18, 2024 13:38
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.

Upgrade packer to new version 2 to allow MCU to send more FF data on UART Push link
2 participants