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

OSK_C_TUTOR - Undefined Method "fsw_name" #111

Open
clxyder opened this issue May 2, 2023 · 10 comments
Open

OSK_C_TUTOR - Undefined Method "fsw_name" #111

clxyder opened this issue May 2, 2023 · 10 comments

Comments

@clxyder
Copy link

clxyder commented May 2, 2023

After building the application from the GUI, I then attempt to run the osk_c_tutor app, but I run into the following problem:

image

This happened for all the lessons, I hoped that by the last lesson it would have fixed itself.

Do I need to add something to cfs/osk_defs/cfsat_cfe_es_startup.scr?

@clxyder
Copy link
Author

clxyder commented May 3, 2023

I was able to make some progress by adding the following line to my cfs/osk_defs/cfsat_cfe_es_startup.scr

CFE_APP, /cf/osk_c_tutor.so,  OSK_C_DEMO_AppMain,  OSK_C_DEMO,    90,   16384, 0x0, 0;

But that would make the cFS crash immediately when booted up.

So I swapped osk_c_tutor to osk_c_demo in cfs/osk_defs/targets.cmake:

SET(TGT1_APPLIST cfs_lib osk_c_fw kit_ci kit_sch kit_to tftp fm md mm osk_c_tutor example)

I also update the startup script accordingly,

CFE_APP, /cf/osk_c_demo.so,  OSK_C_DEMO_AppMain,  OSK_C_DEMO,    90,   16384, 0x0, 0;

Which would now allow for the cFS to boot up without crashing, but when I pressed the Screen button in the CFSAT OSK_C_LESSON_SCR window and the pressed the NOOP button to send a no-op command I got an error that said:

NoMethodError : undefined method: `send_cmd` for nil:NilClass

Does anyone know what I might be missing?

@dmccomas
Copy link
Contributor

dmccomas commented May 3, 2023 via email

@clxyder
Copy link
Author

clxyder commented May 4, 2023

Thank you @dmccomas I will keep playing around with it and report back.

@clxyder
Copy link
Author

clxyder commented May 5, 2023

Turns out osk_c_tutor.so was crashing because I did not properly copy over some parts of the code.

I diff'd my src directory with the solutions of each lesson, updated each file accordingly and osk_c_tutor.so is no longer crashing immediately.

But I am still running into the issue when I press the Run button from the cFS via the CFSAT OSK_C_LESSON_SCR:

NoMethodError : undefined method: `fsw_name` for nil:NilClass

If I ignore the warning and then pressed the Screen button to open the OSK_D_DEMO DEMO_OPS_SCREEN and press the No Op button. I get the same error as before:

NoMethodError : undefined method: `send_cmd` for nil:NilClass

I verified that the osk_c_tutor app is working fine because I am able to open the Command Sender window and send a NOOP command to the app.

Then, from the Packet Viewer: Formatted Telemetry with Units window, I can see the OSK_C_DEMO HK_TLM_PKT valid command counter increase.

I can also see the cFS console window display the NOOP event message:

EVS Port1 42/1/OSK_C_DEMO 101: No operation command received for OSK_C_DEMO App version 1.6.0

So this seems like there is an issue with how the cosmos GUI is linking with the osk_c_tutor lesson plan.

@clxyder
Copy link
Author

clxyder commented May 5, 2023

If I press Ops Example from the OSK_D_DEMO DEMO_OPS_SCREEN window and then press Start the script progresses to line 131:

Osk::flight.send_cmd("OSK_C_DEMO", "NOOP")

Which is when I get the following error in the Script Output section:

2023/05/05 12:23:50.323 (osk_c_demo_ops_example.rb:131): ERROR: RuntimeError : Undefined application OSK_C_DEMO. Verify COSMOS target defined and target defined in ~/OpenSatKit-master/cosmos/config/targets/CFS_KIT/osk/cfs_kit.json

I get the same result if I swap the following two lines in the startup script:

CFE_APP, /cf/osk_c_demo.so,   OSK_C_DEMO_AppMain,  OSK_C_DEMO,    90,   16384, 0x0, 0;
!CFE_APP, /cf/osk_c_tutor.so,  OSK_C_DEMO_AppMain,  OSK_C_DEMO,    90,   16384, 0x0, 0;

Is there anything specific I need to add to that json file?

@clxyder
Copy link
Author

clxyder commented May 5, 2023

Okay I was able to fix the issue.

We need to add OSK_C_DEMO to the list associated with the app key in cosmos/config/targets/CFSAT/osk/cfsat.json

"apps": [ "FM", "KIT_CI", "KIT_SCH", "KIT_TO", "MD", "MM", "TFTP", "OSK_C_DEMO"]

Although, if you press the Run button from the CFSAT OSK_C_LESSON_SCR window, you will get the following error:

1980-012-14:03:56.12408 ES Startup: Could not load cFE application file:/cf/osk_c_demo.so. EC = 0xFFFFFFF1
EVS Port1 42/1/CFE_ES 26: Failed to start OSK_C_DEMO from /cf/osk_c_demo.so, RC = 0xC4000004

But, we should be okay since osk_c_tutor is currently loaded instead of the main demo app.

Note, I added both osk_c_tutor and osk_c_demo to my cfs/osk_defs/targets.cmake:

SET(TGT1_APPLIST cfs_lib osk_c_fw kit_ci kit_sch kit_to tftp fm md mm osk_c_tutor osk_c_demo example)

And I added the following two lines to my cfs/osk_defs/cfsat_cfe_es_startup.scr start up script:

CFE_APP, /cf/osk_c_tutor.so,  OSK_C_DEMO_AppMain,  OSK_C_DEMO,    90,   16384, 0x0, 0;
!CFE_APP, /cf/osk_c_demo.so,   OSK_C_DEMO_AppMain,  OSK_C_DEMO,    90,   16384, 0x0, 0;

After swapping, one for the other I rebuild the project with:

make install

Interestingly enough, if I swap to use osk_c_demo I still see the error. But I am still able to run the OSK_D_DEMO DEMO_OPS_SCREEN.

I was able to run through most of the Ops Example script except for the fact that the FILEMGR app was not loaded for both osk_c_demo and osk_c_tutor.

@clxyder clxyder closed this as completed May 5, 2023
@dmccomas
Copy link
Contributor

dmccomas commented May 8, 2023

Thanks for the good detective work! I'm reopening the issue and will fix the "apps": [ "FM", "KIT_CI", "KIT_SCH", "KIT_TO", "MD", "MM", "TFTP", "OSK_C_DEMO"].

There's additional cleanup I need to do since I removed the sandbox target. Prior to the sandbox target removal, OSK_C_DEMO was delivered as part of the sandbox and OSK_C_TUTOR was developed within the context of the CFSAT target. Now only CFSAT exists so this strategy should be reworked within the context of a single CFSAT target.

@dmccomas dmccomas reopened this May 8, 2023
@clxyder
Copy link
Author

clxyder commented May 10, 2023

Would you like for me to open a PR? Or is there something I can help you with?

@dmccomas
Copy link
Contributor

dmccomas commented Jun 9, 2023 via email

@clxyder
Copy link
Author

clxyder commented Jun 10, 2023

Thanks for the response, I will leave the PR open for now. I will try to get a PR out, if not I will close this issue.

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

No branches or pull requests

2 participants