I found YAFFS2 is being supported by RTT as a seperate package.
Since YAFFS2 is using GPL, RTT is using Apache 2, they are totally different.
If I use YAFFS2 with RTT in my project, what codes should use GPL and open source, whole codes?
Not the whole project. YAFFS2 itself is GPL, so any modifications to it need to be open-sourced. Your own code can stay closed as long as it’s clearly separate and not a derived work.
https://club.rt-thread.io/ask/question Geometry Dash