Context. The chemical compositions of globular clusters provide important information on the star formation that occurred at very early times in the Galaxy. In particular the abundance patterns of elements with atomic number z ≤ 13 may shed light on the properties of stars that early on enriched parts of the star-forming gas with the rest-products of hydrogen-burning at high temperatures. Aims. We analyse and discuss the chemical compositions of a large number of elements in 21 red giant branch stars in the metal-poor globular cluster NGC 6397. We compare the derived abundance patterns with theoretical predictions in the framework of the "wind of fast rotating massive star"-scenario. Methods. High-resolution spectra were obtained with the FLAMES/UVES spectrograph on the VLT. We determined non-LTE abundances of Na, and LTE abundances for the remaining 21 elements, including O (from the [OI] line at 630 nm), Mg, Al, α, iron-peak, and neutron-capture elements, many of which had not been previously analysed for this cluster. We also considered the influence of possible He enrichment in the analysis of stellar spectra. Results. We find that the Na abundances of evolved, as well as unevolved, stars in NGC 6397 show a distinct bimodality, which is indicative of two stellar populations: one primordial stellar generation of composition similar to field stars, and a second generation that is polluted with material processed during hydrogen-burning, i.e., enriched in Na and Al and depleted in O and Mg. The red giant branch exhibits a similar bimodal distribution in the Strömgren colour index c y = c 1 − (b − y), implying that there are also large differences in the N abundance. The two populations have the same composition for all analysed elements heavier than Al, within the measurement uncertainty of the analysis, with the possible exception of [Y/Fe]. Using two stars with almost identical stellar parameters, one from each generation, we estimate the difference in He content, ΔY = 0.01 ± 0.06, given the assumption that the mass fraction of iron is the same for the stars. Conclusions. NGC 6397 hosts two stellar populations that have different chemical compositions of N, O, Na, Mg, and probably Al. The cluster is dominated (75%) by the second generation. We show that massive stars of the first generation can be held responsible for the abundance patterns observed in the second generation long-lived stars of NGC 6397. We estimate that the initial mass of this globular cluster is at least ten times higher than its present-day value.