-
Notifications
You must be signed in to change notification settings - Fork 0
Build Warning: Avoid using getcwd #21
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: main
Are you sure you want to change the base?
Conversation
Parithi098
commented
Oct 17, 2025
- used to write() API to generate bin to avoid build warnings
| .cfg_type=CFG_FILE_R, | ||
| .value_addr=&cfg.sjtag_debug_token, | ||
| .argument_type=required_argument, | ||
| .help="Optional Argument. If not provided, the Debug Token will be generated\n" |
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.
is it like if not provided, debug token will not be generated.
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.
@rarun-mchp both arguments 'i'(debug_token_input_file) and 'o'(debug_token_output_file) are optional.
'o' is for SJTAG unlocking with HSM
'i' is for SJTAG unlocking without HSM
'o' with file name - sjtag_debug_token.bin is the default
i.e., switchtec mfg sjtag-unlock
So, to answer your question, even if no arguments are provided, debug token bin will still be generated.
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.
expand the help statement.
| fclose(debug_token_bin_file); | ||
| getcwd(dir_path, sizeof(dir_path)); | ||
| printf("Generated SJTAG Debug Token Path: %s/sjtag_debug_token.bin\n", dir_path); | ||
| switchtec_perror("Error saving the Debug token"); |
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.
test this path by providing the invalid absolute path.
| .cfg_type=CFG_FILE_R, | ||
| .value_addr=&cfg.sjtag_debug_token, | ||
| .argument_type=required_argument, | ||
| .help="Optional Argument. If not provided, the Debug Token will be generated\n" |
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.
expand the help statement.